From 3b37fa735224e58fcc23c737b764d13e22c2885b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 29 Nov 2015 14:12:05 +0100 Subject: dns-domain: be more strict when encoding/decoding labels Labels of zero length are not OK, refuse them early on. The concept of a "zero-length label" doesn't exist, a zero-length full domain name however does (representing the root domain). See RFC 2181, Section 11. --- src/test/test-dns-domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/test/test-dns-domain.c') diff --git a/src/test/test-dns-domain.c b/src/test/test-dns-domain.c index f010e4e19a..7ad59d378a 100644 --- a/src/test/test-dns-domain.c +++ b/src/test/test-dns-domain.c @@ -136,7 +136,7 @@ static void test_dns_label_escape_one(const char *what, size_t l, const char *ex } static void test_dns_label_escape(void) { - test_dns_label_escape_one("", 0, "", 0); + test_dns_label_escape_one("", 0, NULL, -EINVAL); test_dns_label_escape_one("hallo", 5, "hallo", 5); test_dns_label_escape_one("hallo", 6, NULL, -EINVAL); test_dns_label_escape_one("hallo hallo.foobar,waldi", 24, "hallo\\032hallo\\.foobar\\044waldi", 31); -- cgit v1.2.3-54-g00ecf