]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: resolvers: fix the resolv_dn_label_to_str() API about trailing zero
authorWilly Tarreau <w@1wt.eu>
Thu, 14 Oct 2021 06:05:25 +0000 (08:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 14 Oct 2021 19:24:18 +0000 (21:24 +0200)
commit875ee704dd76b12e5db9ad5c9ae5f2a23b4a4a86
treebb73c901c289af7172ecafaa87b7809a66e0528e
parent85c15e6bff92c2dae609d76f72c1d231d048dd74
MINOR: resolvers: fix the resolv_dn_label_to_str() API about trailing zero

This function suffers from the same API issue as its sibling that does the
opposite direction, it demands that the input string is zero-terminated
*and* that its length *including* the trailing zero is passed on input,
forcing callers to pass length + 1, and itself to use that length - 1
everywhere internally.

This patch addressess this. There is a single caller, which is the
location of the previous bug, so it should probably be backported at
least to keep the code consistent across versions. Note that the
function is called dns_dn_label_to_str() in 2.3 and earlier.
src/resolvers.c