X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;ds=sidebyside;f=ucimap.c;h=e51cd2b8bc77e3436427c7f31aa6f6fcce821fb0;hb=43ff3a3a5489f214ddcabefe375215148e534f84;hp=dddbafc92d410cbca6f5fab0cec2051dd8258d47;hpb=d90507ccd2101ed6788897b7d3b454dd34fa75fe;p=project%2Fuci.git diff --git a/ucimap.c b/ucimap.c index dddbafc..e51cd2b 100644 --- a/ucimap.c +++ b/ucimap.c @@ -216,12 +216,20 @@ ucimap_parse_options(struct uci_map *map, struct uci_sectmap *sm, struct uci_sec section = (unsigned long) sd + sizeof(struct uci_sectmap_data); uci_foreach_element(&s->options, e) { struct uci_optmap *om = NULL; + void *ptr = sm->options; + int size = sm->options_size; + + if (!size) + size = sizeof(struct uci_optmap); for (i = 0; i < sm->n_options; i++) { - if (strcmp(e->name, sm->options[i].name) == 0) { - om = &sm->options[i]; + struct uci_optmap *tmp = ptr; + + if (strcmp(e->name, tmp->name) == 0) { + om = ptr; break; } + ptr = (unsigned char *)ptr + size; } if (!om) continue;