Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;