]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix multi section pass2 parsing
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 13 Mar 2018 18:13:18 +0000 (18:13 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 13 Mar 2018 18:17:37 +0000 (18:17 +0000)
src/main/cf_parse.c

index 7dbe1ad8968dd7deede42395813de592fea3fff6..de2bebcd30d2807ee9303519dd7c349dc5200ce8 100644 (file)
@@ -1226,14 +1226,10 @@ int cf_section_parse_pass2(void *base, CONF_SECTION *cs)
                                size_t          j, len;
                                uint8_t         **array;
 
-                               array = (uint8_t **)((uint8_t *)base) + rule->offset;
+                               array = *(uint8_t ***)(((uint8_t *)base) + rule->offset);
                                len = talloc_array_length(array);
 
-                               for (j = 0; j < len; j++) {
-                                       if (cf_section_parse_pass2(array[j], subcs) < 0) {
-                                               return -1;
-                                       }
-                               }
+                               for (j = 0; j < len; j++) if (cf_section_parse_pass2(array[j], subcs) < 0) return -1;
                                continue;
                        } else {
                                subcs_base = (uint8_t *)base + rule->offset;