From: W.C.A. Wijngaards Date: Thu, 7 Aug 2025 14:19:10 +0000 (+0200) Subject: - Fix to whitespace in dname_str. X-Git-Tag: release-1.24.0rc1~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=752a3f7f521fbc1efcf4de602bcf1fd80dbbf41b;p=thirdparty%2Funbound.git - Fix to whitespace in dname_str. --- diff --git a/doc/Changelog b/doc/Changelog index a3b36d8c7..2cbd25db3 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -3,6 +3,7 @@ for the fix. - Fix that edns-subnet failure to create a subquery errors as servfail, and not formerror. + - Fix to whitespace in dname_str. 6 August 2025: Wouter - Fix edns subnet, so that the subquery without subnet is stored in diff --git a/util/data/dname.c b/util/data/dname.c index fe7188442..5370aa6f9 100644 --- a/util/data/dname.c +++ b/util/data/dname.c @@ -650,11 +650,11 @@ void dname_str(uint8_t* dname, char* str) while(lablen) { len += lablen+1; if(len >= LDNS_MAX_DOMAINLEN) { - if ((s-str) >= (LDNS_MAX_DOMAINLEN-1)) - s = str + LDNS_MAX_DOMAINLEN - 2; - *s++ = '&'; - *s = 0; - return; + if ((s-str) >= (LDNS_MAX_DOMAINLEN-1)) + s = str + LDNS_MAX_DOMAINLEN - 2; + *s++ = '&'; + *s = 0; + return; } if(lablen > LDNS_MAX_LABELLEN) { *s++ = '#'; @@ -666,7 +666,7 @@ void dname_str(uint8_t* dname, char* str) || *dname == '-' || *dname == '_' || *dname == '*') *s++ = *(char*)dname++; - else { + else { *s++ = '?'; dname++; }