dns-domain: enforce maximum DNS domain name length

This commit is contained in:
Lennart Poettering
2014-07-17 01:41:52 +02:00
parent 0014a4ad50
commit 76f468c8ea
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -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;
+1
View File
@@ -25,6 +25,7 @@
#include "in-addr-util.h"
#define DNS_LABEL_MAX 63
#define DNS_NAME_MAX 255
int dns_label_unescape(const char **name, char *dest, size_t sz);
int dns_label_escape(const char *p, size_t l, char **ret);