summaryrefslogtreecommitdiff
path: root/src/test/test-dns-domain.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-06-11 05:51:03 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-06-11 06:01:46 +0900
commit9db01ca5b0322bc035e1ccd6b8a0d98a26533b4a (patch)
tree71021bbbfda663ccecc171ac7a13695efe925e9a /src/test/test-dns-domain.c
parent288bafa952b1d515e10bdf8c8f0adde3acbbe4be (diff)
downloadsystemd-9db01ca5b0322bc035e1ccd6b8a0d98a26533b4a.tar.gz
dns-domain: make each label nul-terminated
dns_label_unescape() does not nul-terminate the buffer if it does not have enough space. Hence, if a lable is enough long, then strjoin() triggers buffer-overflow. Fixes #23705.
Diffstat (limited to 'src/test/test-dns-domain.c')
-rw-r--r--src/test/test-dns-domain.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/test-dns-domain.c b/src/test/test-dns-domain.c
index 3a26ecaa70..0fbac9dbd9 100644
--- a/src/test/test-dns-domain.c
+++ b/src/test/test-dns-domain.c
@@ -540,6 +540,7 @@ TEST(dns_service_split) {
test_dns_service_split_one("_foo._bar", NULL, "_foo._bar", ".", 0);
test_dns_service_split_one("_meh._foo._bar", "_meh", "_foo._bar", ".", 0);
test_dns_service_split_one("Wuff\\032Wuff._foo._bar.waldo.com", "Wuff Wuff", "_foo._bar", "waldo.com", 0);
+ test_dns_service_split_one("_Q._Q-------------------------------------------------------------", NULL, "_Q._Q-------------------------------------------------------------", ".", 0);
}
static void test_dns_name_change_suffix_one(const char *name, const char *old_suffix, const char *new_suffix, int r, const char *result) {