]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Pass empty string instead of NULL to ns_client_dumpmessage()
authorOndřej Surý <ondrej@isc.org>
Wed, 6 May 2026 08:12:35 +0000 (10:12 +0200)
committerOndřej Surý <ondrej@sury.org>
Wed, 6 May 2026 11:38:12 +0000 (13:38 +0200)
The two new call sites added by the CLASS-validation work passed NULL
as the reason, but ns_client_dumpmessage() bails out early on a NULL
reason — so the message dump never happened. The intent was to dump
the message and let the follow-up ns_client_log() carry the reason
text, so pass "" to suppress the prefix without short-circuiting the
dump.

(cherry picked from commit 8af39c360407a92ef31bf233b9df760d1bb9fb5f)

lib/ns/client.c

index cbc8a0483624f6f60116e3b86a039f6d2c9d7348..c65ebbbdd8f7155571e5cb458debee3dacf83b3e 100644 (file)
@@ -2006,7 +2006,7 @@ ns__client_request(isc_nmhandle_t *handle, isc_result_t eresult,
        default:
                dns_rdataclass_format(client->message->rdclass, classbuf,
                                      sizeof(classbuf));
-               ns_client_dumpmessage(client, NULL);
+               ns_client_dumpmessage(client, "");
                ns_client_log(client, NS_LOGCATEGORY_CLIENT,
                              NS_LOGMODULE_CLIENT, ISC_LOG_DEBUG(1),
                              "invalid message class: %s", classbuf);
@@ -2050,7 +2050,7 @@ ns__client_request(isc_nmhandle_t *handle, isc_result_t eresult,
                ns_client_log(client, NS_LOGCATEGORY_CLIENT,
                              NS_LOGMODULE_CLIENT, ISC_LOG_DEBUG(1),
                              "no matching view in class '%s'", classname);
-               ns_client_dumpmessage(client, NULL);
+               ns_client_dumpmessage(client, "");
                ns_client_error(client, notimp ? DNS_R_NOTIMP : DNS_R_REFUSED);
                isc_task_unpause(client->task);
                return;
@@ -2343,7 +2343,7 @@ ns__client_setup(ns_client_t *client, ns_clientmgr_t *mgr, bool new) {
         * The caller is responsible for that.
         */
 
-       REQUIRE(NS_CLIENT_VALID(client) || (new &&client != NULL));
+       REQUIRE(NS_CLIENT_VALID(client) || (new && client != NULL));
        REQUIRE(VALID_MANAGER(mgr) || !new);
 
        if (new) {