Commit 9638f671 authored by Manuel Schölling's avatar Manuel Schölling Committed by David S. Miller

dns_resolver: Do not accept domain names longer than 255 chars

According to RFC1035 "[...] the total length of a domain name (i.e.,
label octets and label length octets) is restricted to 255 octets or
less."
Signed-off-by: default avatarManuel Schölling <manuel.schoelling@gmx.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 555878b9
......@@ -93,8 +93,8 @@ int dns_query(const char *type, const char *name, size_t namelen,
}
if (!namelen)
namelen = strlen(name);
if (namelen < 3)
namelen = strnlen(name, 256);
if (namelen < 3 || namelen > 255)
return -EINVAL;
desclen += namelen + 1;
......
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