MINOR: resolvers: fix the resolv_str_to_dn_label() API about trailing zero

This function is bogus at the API level: it demands that the input string
is zero-terminated *and* that its length *including* the trailing zero is
passed on input. While that already looks smelly, the trailing zero is
copied as-is, and is then explicitly replaced with a zero... Not only
all callers have to pass hostname_len+1 everywhere to work around this
absurdity, but this requirement causes a bug in the do-resolve() action
that passes random string lengths on input, and that will be fixed on a
subsequent patch.

Let's fix this API issue for now.

This patch will have to be backported, and in versions 2.3 and older,
the function is in dns.c and is called dns_str_to_dn_label().

(cherry picked from commit bf9498a31beb41078ebf257c54b7acb879bcb98b)
Signed-off-by: Willy Tarreau <w@1wt.eu>
diff --git a/src/server.c b/src/server.c
index ff88dcb..ff55734 100644
--- a/src/server.c
+++ b/src/server.c
@@ -2009,7 +2009,7 @@
 
 	hostname_len    = strlen(hostname);
 	hostname_dn     = trash.area;
-	hostname_dn_len = resolv_str_to_dn_label(hostname, hostname_len + 1,
+	hostname_dn_len = resolv_str_to_dn_label(hostname, hostname_len,
 	                                         hostname_dn, trash.size);
 	if (hostname_dn_len == -1)
 		goto err;
@@ -3686,7 +3686,7 @@
 	chunk_reset(&trash);
 	hostname_len    = strlen(hostname);
 	hostname_dn     = trash.area;
-	hostname_dn_len = resolv_str_to_dn_label(hostname, hostname_len + 1,
+	hostname_dn_len = resolv_str_to_dn_label(hostname, hostname_len,
 	                                         hostname_dn, trash.size);
 	if (hostname_dn_len == -1)
 		goto err;