From: Michal Nowak Date: Thu, 23 Jul 2026 09:18:34 +0000 (+0200) Subject: Add missing putnull() to named_smf_add_message() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=693d50d40aa9a9011421ffa9e4ec39a4d1808cd0;p=thirdparty%2Fbind9.git Add missing putnull() to named_smf_add_message() 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 --- diff --git a/bin/named/server.c b/bin/named/server.c index 0d6c6c6d210..89a30b07fd2 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -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 */