]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix a bug in dns_tkey_processquery()
authorAram Sargsyan <aram@isc.org>
Fri, 20 Feb 2026 11:18:52 +0000 (11:18 +0000)
committerMichał Kępień <michal@isc.org>
Fri, 13 Mar 2026 12:38:07 +0000 (13:38 +0100)
The 'keyname' variable could be used in the add_rdata_to_list()
call without being initialized. Make sure that 'keyname' is non-NULL
for all the cases that do not jump to the 'cleanup:' label.

lib/dns/tkey.c

index 9f71c4e41cfc76cc5e76a82e0f8d2eb8f5520c25..f09edc2a9c4d25ae022c65cdbe075ce5786d8086 100644 (file)
@@ -401,7 +401,8 @@ dns_tkey_processquery(dns_message_t *msg, dns_tkeyctx_t *tctx,
                /*
                 * A delete operation uses the fully specified qname.
                 */
-               CHECK(process_deletetkey(signer, qname, &tkeyin, &tkeyout,
+               keyname = qname;
+               CHECK(process_deletetkey(signer, keyname, &tkeyin, &tkeyout,
                                         ring));
                break;
        case DNS_TKEYMODE_GSSAPI:
@@ -443,6 +444,10 @@ dns_tkey_processquery(dns_message_t *msg, dns_tkeyctx_t *tctx,
                result = DNS_R_NOTIMP;
                goto cleanup;
        default:
+               /*
+                * For unrecognized modes also use the fully specified qname.
+                */
+               keyname = qname;
                tkeyout.error = dns_tsigerror_badmode;
        }