summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>2017-11-23 07:56:49 +0000
committerzherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>2017-11-23 07:56:49 +0000
commit4edb99ec234ce484bedaaa0777c8abf749fd515f (patch)
tree0a75f332e36fb5365341aa1462e38f38bc0edcaf
parent22f62c95b3269f8a17e90283541e33c1f6dcaab9 (diff)
downloadpcre-4edb99ec234ce484bedaaa0777c8abf749fd515f.tar.gz
Fix pcre_jit_exec early check.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1715 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog5
-rw-r--r--pcre_jit_compile.c2
2 files changed, 6 insertions, 1 deletions
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. */