]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fix unitiailized pointer check on getipandkeylist
authorColin Vidal <colin@isc.org>
Fri, 28 Nov 2025 10:55:32 +0000 (11:55 +0100)
committerColin Vidal <colin@isc.org>
Fri, 28 Nov 2025 14:38:18 +0000 (15:38 +0100)
Function `named_config_getipandkeylist` could, in case of error in the
early code attempting to get the `port` or `tls-port`, make a pointer
check on a non-initialized value. This is now fixed.

(cherry picked from commit 954503b9f5c0a3ea7720ef5a72a4ea65dff9dee2)

bin/named/config.c

index e247557b0b12fcedee18eb9c99a074782a89645a..693080dce59f73ff6c85063b2db9bb00ee2cdddd 100644 (file)
@@ -819,6 +819,7 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
        isc_result_t result;
        in_port_t def_port;
        in_port_t def_tlsport;
+       getipandkeylist_state_t s = {};
 
        REQUIRE(ipkl != NULL);
        REQUIRE(ipkl->count == 0);
@@ -844,7 +845,6 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
        /*
         * Process the (nested) list(s).
         */
-       getipandkeylist_state_t s = {};
        result = getipandkeylist(def_port, def_tlsport, config, list,
                                 (in_port_t)0, NULL, NULL, mctx, &s);
        if (result != ISC_R_SUCCESS) {