]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: The function "regex_exec" needs the string length but in many case they...
authorThierry FOURNIER <tfournier@exceliance.fr>
Tue, 15 Oct 2013 11:41:44 +0000 (13:41 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Oct 2013 10:19:51 +0000 (12:19 +0200)
commitef37a66628186326b9ed65e47396fbcd6337eee7
treea143bb606faa52d8f4f5ebd44ffe15b5982b71ba
parent9e5cc8d63ae539a9aa58858a1d9fa3b0b0e74eee
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.
include/common/regex.h
src/acl.c