dns-domain: make each label nul-terminated
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 Jun 2022 20:51:03 +0000 (05:51 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 Jun 2022 21:01:46 +0000 (06:01 +0900)
commit9db01ca5b0322bc035e1ccd6b8a0d98a26533b4a
tree71021bbbfda663ccecc171ac7a13695efe925e9a
parent288bafa952b1d515e10bdf8c8f0adde3acbbe4be
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.
src/shared/dns-domain.c
src/test/test-dns-domain.c