]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: regex: fix pcre_study error handling
authorChristian Ruppert <c.ruppert@babiel.com>
Wed, 29 Oct 2014 16:05:53 +0000 (17:05 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 29 Oct 2014 16:44:31 +0000 (17:44 +0100)
commit955f4613cb457a93bb278e47a9af19bf5479d27d
treef85a20ed9ceae1563e74bd86a81d062fa781ad4d
parenta616ba6f5fbee93134f121ac1da47397b071f365
BUG/MEDIUM: regex: fix pcre_study error handling

pcre_study() may return NULL even though it succeeded. In this case error is
NULL otherwise error is not NULL. Also see man 3 pcre_study.

Previously a ACL pattern of e.g. ".*" would cause error because pcre_study did
not found anything to speed up matching and returned regex->extra = NULL and
error = NULL which in this case was a false-positive. That happend only when
PCRE_JIT was enabled for HAProxy but libpcre has been built without JIT.

Signed-off-by: Christian Ruppert <c.ruppert@babiel.com>
[wt: this needs to be backported to 1.5 as well]
src/regex.c