ndb/dns: check bad name length in convM2DNS.c:^gname()
This commit is contained in:
parent
b77eda8fc7
commit
ad3ba8838d
1 changed files with 7 additions and 3 deletions
|
@ -237,6 +237,10 @@ gname(char *to, RR *rp, Scan *sp)
|
|||
case 0: /* normal label */
|
||||
if(p < sp->ep)
|
||||
n = *p++ & 077; /* pick up length */
|
||||
if(sp->ep - p <= n){
|
||||
sp->err = "bad name length";
|
||||
goto err;
|
||||
}
|
||||
if(len + n < Domlen - 1){
|
||||
if(n > toend - to){
|
||||
errtoolong(rp, sp, toend - to, n,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue