summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-domain.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-17 01:10:47 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-17 01:41:52 +0200
commit76f468c8ea568fce98fa75d7f1d540256eb0940a (patch)
tree1c7c751cfdd40d92c4932b3b5eda2cb5f1a12cc7 /src/resolve/resolved-dns-domain.c
parent0014a4ad505d119c7ac4346d9d774c3f17f663a5 (diff)
dns-domain: enforce maximum DNS domain name length
Diffstat (limited to 'src/resolve/resolved-dns-domain.c')
-rw-r--r--src/resolve/resolved-dns-domain.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-domain.c b/src/resolve/resolved-dns-domain.c
index 27739c1e57..a41052dde3 100644
--- a/src/resolve/resolved-dns-domain.c
+++ b/src/resolve/resolved-dns-domain.c
@@ -203,6 +203,9 @@ int dns_name_normalize(const char *s, char **_ret) {
n += r;
}
+ if (n > DNS_NAME_MAX)
+ return -EINVAL;
+
if (!GREEDY_REALLOC(ret, allocated, n + 1))
return -ENOMEM;