From: Mark Andrews Date: Sun, 15 Dec 2024 22:57:30 +0000 (+1100) Subject: Terminate yaml string after negative comment X-Git-Tag: v9.21.5~37^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89afc1138992def8d03a6cf59e3c9b4ea2185bbb;p=thirdparty%2Fbind9.git Terminate yaml string after negative comment --- diff --git a/lib/dns/masterdump.c b/lib/dns/masterdump.c index db5c1a0febb..fa892c148ab 100644 --- a/lib/dns/masterdump.c +++ b/lib/dns/masterdump.c @@ -767,10 +767,17 @@ rdataset_totext(dns_rdataset_t *rdataset, const dns_name_t *owner_name, INDENT_TO(rdata_column); if ((rdataset->attributes & DNS_RDATASETATTR_NEGATIVE) != 0) { if (NXDOMAIN(rdataset)) { - RETERR(str_totext(";-$NXDOMAIN\n", target)); + RETERR(str_totext(";-$NXDOMAIN", target)); } else { - RETERR(str_totext(";-$NXRRSET\n", target)); + RETERR(str_totext(";-$NXRRSET", target)); } + if (start != NULL) { + RETERR(yaml_stringify(target, start)); + RETERR(str_totext("'\n", target)); + } else { + RETERR(str_totext("\n", target)); + } + /* * Print a summary of the cached records which make * up the negative response.