BUG/MEDIUM: resolvers: fix truncated TLD consecutive to the API fix
authorWilly Tarreau <w@1wt.eu>
Fri, 15 Oct 2021 06:09:25 +0000 (08:09 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 3 Nov 2021 10:21:47 +0000 (11:21 +0100)
commitf7ce8a4d9e4c94c8280aafdec09fd1c8c7714bef
tree52eda2be34f84073d0528ca285fb7de43f51b2df
parenta840e11c0cac02706f55e2ab05b123def2d4e40e
BUG/MEDIUM: resolvers: fix truncated TLD consecutive to the API fix

A bug was introduced by commit previous bf9498a31 ("MINOR: resolvers:
fix the resolv_str_to_dn_label() API about trailing zero") as the code
is particularly contrived and hard to test. The output writes the last
char at [i+1] so the trailing zero and return value must be at i+1.

This will have to be backported where the patch above is backported
since it was needed for a fix.

(cherry picked from commit 7b232f132dc9a0a6ee6fa3fabfa6e50196af9240)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 68c7b36f637c5d9a05b32b2868e44ea838f83f78)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/dns.c