mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Also print out valid printable utf8
This commit is contained in:
parent
b144ae1bb0
commit
1c8f9d06e2
1 changed files with 9 additions and 1 deletions
|
|
@ -4091,11 +4091,16 @@ dns_message_pseudosectiontotext(dns_message_t *msg, dns_pseudosection_t section,
|
|||
|
||||
if (optlen != 0) {
|
||||
int i;
|
||||
bool utf8ok = false;
|
||||
|
||||
ADD_STRING(target, " ");
|
||||
|
||||
optdata = isc_buffer_current(&optbuf);
|
||||
if (optcode != DNS_OPT_EDE) {
|
||||
if (optcode == DNS_OPT_EDE) {
|
||||
utf8ok = isc_utf8_valid(optdata,
|
||||
optlen);
|
||||
}
|
||||
if (!utf8ok) {
|
||||
for (i = 0; i < optlen; i++) {
|
||||
const char *sep;
|
||||
switch (optcode) {
|
||||
|
|
@ -4162,6 +4167,9 @@ dns_message_pseudosectiontotext(dns_message_t *msg, dns_pseudosection_t section,
|
|||
if (isprint(optdata[i])) {
|
||||
isc_buffer_putmem(
|
||||
target, &optdata[i], 1);
|
||||
} else if (utf8ok && optdata[i] > 127) {
|
||||
isc_buffer_putmem(
|
||||
target, &optdata[i], 1);
|
||||
} else {
|
||||
isc_buffer_putstr(target, ".");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue