From 4edb99ec234ce484bedaaa0777c8abf749fd515f Mon Sep 17 00:00:00 2001 From: zherczeg Date: Thu, 23 Nov 2017 07:56:49 +0000 Subject: Fix pcre_jit_exec early check. git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1715 2f5784b3-3f2a-0410-8824-cb99058d5e15 --- ChangeLog | 5 +++++ pcre_jit_compile.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bcd0fc4..d0dc206 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,11 @@ was the possibility of a false positive match when caselessly matching a "not this character" item such as [^\x{1234}] (with a code point greater than 127) because the "other case" variable was not being initialized. +5. Although pcre_jit_exec checks whether the pattern is compiled +in a given mode, it was also expected that at least one mode is available. +This is fixed and pcre_jit_exec returns with PCRE_ERROR_JIT_BADOPTION +when the pattern is not optimized by JIT at all. + Version 8.41 05-July-2017 ------------------------- diff --git a/pcre_jit_compile.c b/pcre_jit_compile.c index 249edbe..6366237 100644 --- a/pcre_jit_compile.c +++ b/pcre_jit_compile.c @@ -11529,7 +11529,7 @@ if ((options & PCRE_PARTIAL_HARD) != 0) else if ((options & PCRE_PARTIAL_SOFT) != 0) mode = JIT_PARTIAL_SOFT_COMPILE; -if (functions->executable_funcs[mode] == NULL) +if (functions->executable_funcs == NULL || functions->executable_funcs[mode] == NULL) return PCRE_ERROR_JIT_BADOPTION; /* Sanity checks should be handled by pcre_exec. */ -- cgit v1.2.1