Skip to content

Commit

Permalink
Fix pcre_jit_exec early check.
Browse files Browse the repository at this point in the history
git-svn-id: svn:https://vcs.exim.org/pcre/code/trunk@1715 2f5784b3-3f2a-0410-8824-cb99058d5e15
  • Loading branch information
zherczeg committed Nov 23, 2017
1 parent 22f62c9 commit 4edb99e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------------------
Expand Down
2 changes: 1 addition & 1 deletion pcre_jit_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 4edb99e

Please sign in to comment.