Skip to content
Snippets Groups Projects
Commit 8bd7fce0 authored by rswindell's avatar rswindell
Browse files

Bounds checking.

parent 9811593b
No related branches found
No related tags found
No related merge requests found
......@@ -342,7 +342,7 @@ int dns_getmx(char* name, char* mx, char* mx2
answers=ntohs(msghdr.ancount);
p=msg+len; /* Skip the header and question portion */
for(i=0;i<answers;i++) {
for(i=0;i<answers && p<msg+sizeof(msg);i++) {
namelen=0;
p+=dns_name(hostname, &namelen, sizeof(hostname)-1, msg+offset, p);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment