]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add missing putnull() to named_smf_add_message() 12369/head
authorMichal Nowak <mnowak@isc.org>
Thu, 23 Jul 2026 09:18:34 +0000 (11:18 +0200)
committerMark Andrews <marka@isc.org>
Mon, 27 Jul 2026 03:50:08 +0000 (13:50 +1000)
The control channel response text needs to be NUL-terminated.
named_smf_add_message() did not do that, so 'rndc stop' or
'rndc halt' on an SMF-managed named running chrooted could echo
uninitialized heap contents after the 'use svcadm(1M) to manage
named' message.

Assisted-by: Claude:claude-fable-5
bin/named/server.c

index 0d6c6c6d2100c7e7ebf75adca099be94d4d42913..89a30b07fd28bd92cd1c2f906bfaf6bc21f2607d 100644 (file)
@@ -12033,9 +12033,16 @@ named_server_freeze(named_server_t *server, bool freeze, isc_lex_t *lex,
  */
 isc_result_t
 named_smf_add_message(isc_buffer_t *text) {
+       isc_result_t result;
+
        REQUIRE(text != NULL);
 
-       return putstr(text, "use svcadm(1M) to manage named");
+       CHECK(putstr(text, "use svcadm(1M) to manage named"));
+       CHECK(putnull(text));
+
+       return ISC_R_SUCCESS;
+cleanup:
+       return result;
 }
 #endif /* HAVE_LIBSCF */