]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Initialise pointers to CONF_SECTION for sections not present in config
authorNick Porter <nick@portercomputing.co.uk>
Tue, 13 Apr 2021 10:48:04 +0000 (11:48 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 13 Apr 2021 14:18:43 +0000 (10:18 -0400)
Without this, processing sections with no config such as a "send Offer"
seg fault when trying to look up compiled CONF_SECTION

src/lib/server/virtual_servers.c

index d3c9b4e4568b6ed21b86408b3156f151b9864137..fe71807841f09ed655606b7cbcf8c58889f5c322 100644 (file)
@@ -1508,6 +1508,12 @@ int virtual_server_compile_sections(CONF_SECTION *server, virtual_server_compile
                        if (!subcs) {
                                DEBUG3("Warning: Skipping %s %s { ... } as it was not found.",
                                       list[i].name, list[i].name2);
+                               /*
+                                *      Initialise CONF_SECTION pointer for missing section
+                                */
+                               if ((uctx) && (list[i].offset > 0)) {
+                                       *(CONF_SECTION **) (((uint8_t *) uctx) + list[i].offset) = NULL;
+                               }
                                continue;
                        }