]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: resolvers: Fix test on dn label size in resolv_dn_label_to_str()
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 22 May 2026 09:13:30 +0000 (11:13 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 22 May 2026 09:13:33 +0000 (11:13 +0200)
commit75f72c2eb9185fb99f8dd322734b8ddae8dc2d56
tree4e9b40c4082131d1465dab6adb2626595f99f6d6
parent1ed4ef6659268c1b257d2640308dbd8367a31695
BUG/MEDIUM: resolvers: Fix test on dn label size in resolv_dn_label_to_str()

In resolv_dn_label_to_str(), size for a dn label was stored into an integer
from a signed char without a cast to unsigned. So dn label with a size of
128 bytes or more become negative, skipping this way the copy loop and
desynchronizing input vs output.

In addition, the size of the destination string was only checked at the
begining, against the dn string length. But it must also be checked for
every dn label, to be sure. The dn string can be forged to copied more bytes
than expected.

This patch must be backported to all stable versions.
src/resolvers.c