mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-29 19:09:36 -05:00
- Fix RPZ's get_tld_label maxdnamelen check
This commit is contained in:
parent
9df07b4036
commit
ef120738c0
1 changed files with 5 additions and 1 deletions
|
|
@ -118,13 +118,17 @@ get_tld_label(uint8_t* dname, size_t maxdnamelen)
|
|||
uint8_t* prevlab = dname;
|
||||
size_t dnamelen = 0;
|
||||
|
||||
/* one byte needed for label length */
|
||||
if(dnamelen+1 > maxdnamelen)
|
||||
return NULL;
|
||||
|
||||
/* only root label */
|
||||
if(*dname == 0)
|
||||
return NULL;
|
||||
|
||||
while(*dname) {
|
||||
dnamelen += ((size_t)*dname)+1;
|
||||
if(dnamelen > maxdnamelen)
|
||||
if(dnamelen+1 > maxdnamelen)
|
||||
return NULL;
|
||||
dname = dname+((size_t)*dname)+1;
|
||||
if(*dname != 0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue