Commit b98f7715 authored by Giovanni Bajo's avatar Giovanni Bajo Committed by Simon Kelley

Filter out invalid characters in domain names.

parent c7a93f6e
...@@ -93,6 +93,8 @@ static int extract_name_no_compression(unsigned char *rr, int maxlen, char *buf) ...@@ -93,6 +93,8 @@ static int extract_name_no_compression(unsigned char *rr, int maxlen, char *buf)
while (count-- >= 0 && rr < end) while (count-- >= 0 && rr < end)
{ {
*buf = *rr++; *buf = *rr++;
if (!isascii(*buf) || iscntrl(*buf) || *buf == '.')
return 0;
if (*buf >= 'A' && *buf <= 'Z') if (*buf >= 'A' && *buf <= 'Z')
*buf += 'a' - 'A'; *buf += 'a' - 'A';
buf++; buf++;
......
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