Commit 4153c4bd authored by Antonin Décimo's avatar Antonin Décimo Committed by Juliusz Chroboczek

Fix possible array overrun.

If there are 16 slots, then the maximum index is 15.
parent 121f4956
......@@ -241,11 +241,11 @@ main(int argc, char **argv)
int af;
af = parse_address(optarg, buf);
if(af == 4) {
if(numdnsv4 > 16)
if(numdnsv4 >= 16)
goto usage;
memcpy(dnsv4[numdnsv4++], buf, 4);
} else if(af == 6) {
if(numdnsv6 > 16)
if(numdnsv6 >= 16)
goto usage;
memcpy(dnsv6[numdnsv6++], buf, 16);
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment