diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c index c496e54e5ec141..f0d8f716dfc47f 100644 --- a/src/resolve/resolved-dns-packet.c +++ b/src/resolve/resolved-dns-packet.c @@ -564,6 +564,12 @@ int dns_packet_append_name( assert(p); assert(name); + r = dns_name_is_valid(name); + if (r < 0) + return r; + if (r == 0) + return -EINVAL; + if (p->refuse_compression) allow_compression = false;