Fix the dname_str method to cause conversion errors when the domain name length is 255

This commit is contained in:
wenxuan70 2024-11-24 17:53:23 +08:00
parent 9e3c50ec9e
commit 06fb30d0a0

View file

@ -654,7 +654,7 @@ void dname_str(uint8_t* dname, char* str)
return;
}
len += lablen+1;
if(len >= LDNS_MAX_DOMAINLEN-1) {
if(len >= LDNS_MAX_DOMAINLEN) {
*s++ = '&';
*s = 0;
return;