From: Nick Porter Date: Tue, 13 Apr 2021 10:48:04 +0000 (+0100) Subject: Initialise pointers to CONF_SECTION for sections not present in config X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca25988bcf43316bccefc780d68fa7f1b53c91c7;p=thirdparty%2Ffreeradius-server.git Initialise pointers to CONF_SECTION for sections not present in config Without this, processing sections with no config such as a "send Offer" seg fault when trying to look up compiled CONF_SECTION --- diff --git a/src/lib/server/virtual_servers.c b/src/lib/server/virtual_servers.c index d3c9b4e4568..fe71807841f 100644 --- a/src/lib/server/virtual_servers.c +++ b/src/lib/server/virtual_servers.c @@ -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; }