From 0ddf996441b3465e968be5d0aa61e5b6f3dbdbe2 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 21 Jul 2023 00:15:15 +0000 Subject: Fix noqualify for /etc/hosts compilation Signed-off-by: Laurent Bercot --- src/libs6dns/s6dns_hosts_compile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libs6dns/s6dns_hosts_compile.c') diff --git a/src/libs6dns/s6dns_hosts_compile.c b/src/libs6dns/s6dns_hosts_compile.c index cf3e304..b57ffd3 100644 --- a/src/libs6dns/s6dns_hosts_compile.c +++ b/src/libs6dns/s6dns_hosts_compile.c @@ -230,7 +230,8 @@ static int s6dns_hosts_parse (buffer *b, hostdata *hd) else { uint32_t d ; - if (!stralloc_catb(&hd->storage, ".", 2)) goto err ; + if ((hd->storage.s[hd->storage.len - 1] != '.' && !stralloc_catb(&hd->storage, ".", 1)) + || !stralloc_0(&hd->storage)) goto err ; if (!avltree_search(&hd->byfqdn, hd->storage.s + mark, &d)) { if (!gensetdyn_new(&hd->fqdn, &d)) goto err ; -- cgit v1.2.3