fix parseip()
addresses like: "1:2:3:4:5:6:7:255.255.255.255" caused parseip to write beyond the ip buffer.
This commit is contained in:
parent
e8c1d0fe7c
commit
4c2d520eef
1 changed files with 4 additions and 0 deletions
|
@ -74,6 +74,10 @@ parseip(uchar *to, char *from)
|
|||
op = p;
|
||||
x = strtoul(p, &p, 16);
|
||||
if(*p == '.' || (*p == 0 && i == 0)){ /* ends with v4? */
|
||||
if(i > IPaddrlen-4){
|
||||
memset(to, 0, IPaddrlen);
|
||||
return -1; /* parse error */
|
||||
}
|
||||
p = v4parseip(to+i, op);
|
||||
i += 4;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue