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
*/
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 */