]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: dns: make the port numbers unsigned
authorWilly Tarreau <w@1wt.eu>
Wed, 22 May 2019 18:07:45 +0000 (20:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 May 2019 18:07:45 +0000 (20:07 +0200)
commitd1f56c9a0110805c4a5f3afba2990556cb74ec8b
treec67a432ca7d6355ed01c01756f703bf2a827319a
parent3844747536adbb1914740d14dadb0e91a5b9d25a
BUG/MEDIUM: dns: make the port numbers unsigned

Mustafa Yildirim reported in Discourse that ports >32767 advertised
in SRV records are wrong. Given the high value they definitely
correspond to a sign extension of a negative number. The cause was
indeed that the port is declared as a signed int in the dns_answer_item
structure, and Lukas confirmed in github issue #103 that turning it to
unsigned addresses the issue.

It is worth noting that there are other such fields in this structure
that don't look right (ttl, priority, class, type) and that someone
should audit this part to be certain they are properly typed.

This fix must be backported to 1.9 and likely to 1.8 as well.
include/types/dns.h