]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix escape more characters when printing an RR type with an unquoted
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 1 Apr 2025 11:53:29 +0000 (13:53 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 1 Apr 2025 11:53:29 +0000 (13:53 +0200)
  string.

doc/Changelog
sldns/wire2str.c

index 3f97652e15c47d08af081f6772e2dc852572b396..23dd28ab0151de760a69aadbd128c9c057df4ff0 100644 (file)
@@ -1,3 +1,7 @@
+1 April 2025: Wouter
+       - Fix escape more characters when printing an RR type with an unquoted
+         string.
+
 31 March 2025: Wouter
        - iana portlist update.
        - Merge #1042: Fast Reload. The unbound-control fast_reload is added.
index f43b47168204da95211c9123d23e93daa70e180b..1bc5b9cf6e93c5f7c84689f7b419ad3b02ea5354 100644 (file)
@@ -2059,7 +2059,8 @@ int sldns_wire2str_unquoted_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
        (*d)++;
        (*dl)--;
        for(i=0; i<len; i++) {
-               if(isspace((unsigned char)(*d)[i]))
+               if(isspace((unsigned char)(*d)[i]) || (*d)[i] == '(' ||
+                       (*d)[i] == ')' || (*d)[i] == '\'')
                        w += sldns_str_print(s, sl, "\\%c", (char)(*d)[i]);
                else    w += str_char_print(s, sl, (*d)[i]);
        }