projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
555878b
)
dns_resolver: Do not accept domain names longer than 255 chars
author
Manuel Schölling
<manuel.schoelling@gmx.de>
Sat, 31 May 2014 21:37:40 +0000
(23:37 +0200)
committer
David S. Miller
<davem@davemloft.net>
Thu, 5 Jun 2014 07:05:53 +0000
(
00:05
-0700)
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: Manuel Schölling <manuel.schoelling@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dns_resolver/dns_query.c
patch
|
blob
|
history
diff --git
a/net/dns_resolver/dns_query.c
b/net/dns_resolver/dns_query.c
index
e7b6d53
..
5b49958
100644
(file)
--- a/
net/dns_resolver/dns_query.c
+++ b/
net/dns_resolver/dns_query.c
@@
-93,8
+93,8
@@
int dns_query(const char *type, const char *name, size_t namelen,
}
if (!namelen)
- namelen = str
len(name
);
- if (namelen < 3)
+ namelen = str
nlen(name, 256
);
+ if (namelen < 3
|| namelen > 255
)
return -EINVAL;
desclen += namelen + 1;