CLEANUP: The function "regex_exec" needs the string length but in many case they expect null terminated char.

If haproxy is compiled with the USE_PCRE_JIT option, the length of the
string is used. If it is compiled without this option the function doesn't
use the length and expects a null terminated string.

The prototype of the function is ambiguous, and depends on the
compilation option. The developer can think that the length is always
used, and many bugs can be created.

This patch makes sure that the length is used. The regex_exec function
adds the final '\0' if it is needed.
diff --git a/src/acl.c b/src/acl.c
index 89bfdf5..e6cbd30 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -163,19 +163,9 @@
  */
 int acl_match_reg(struct sample *smp, struct acl_pattern *pattern)
 {
-	char old_char;
-	int ret;
-
-	old_char = smp->data.str.str[smp->data.str.len];
-	smp->data.str.str[smp->data.str.len] = 0;
-
 	if (regex_exec(pattern->ptr.reg, smp->data.str.str, smp->data.str.len) == 0)
-		ret = ACL_PAT_PASS;
-	else
-		ret = ACL_PAT_FAIL;
-
-	smp->data.str.str[smp->data.str.len] = old_char;
-	return ret;
+		return ACL_PAT_PASS;
+	return ACL_PAT_FAIL;
 }
 
 /* Checks that the pattern matches the beginning of the tested string. */