Skip to content

Commit

Permalink
resolved: explicitly refuse adding invalid DNS names to DNS packets
Browse files Browse the repository at this point in the history
Fixes: systemd#33671
(cherry picked from commit e637856)
  • Loading branch information
poettering authored and bluca committed Nov 13, 2024
1 parent 5b3dd2d commit c18b1ad
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/resolve/resolved-dns-packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c18b1ad

Please sign in to comment.