Revision: 884
http://www.exim.org/viewvc/pcre2?view=rev&revision=884
Author: zherczeg
Date: 2017-11-23 07:54:39 +0000 (Thu, 23 Nov 2017)
Log Message:
-----------
Fix pcre2_jit_match early check.
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/src/pcre2_jit_match.c
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2017-11-16 17:44:50 UTC (rev 883)
+++ code/trunk/ChangeLog 2017-11-23 07:54:39 UTC (rev 884)
@@ -55,7 +55,12 @@
compressed file (.gz or .bz2) a segfault occurred. (Line buffering should be
ignored for compressed files.)
+15. Although pcre2_jit_match 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 pcre2_jit_match returns with PCRE2_ERROR_JIT_BADOPTION
+when the pattern is not optimized by JIT at all.
+
Version 10.30 14-August-2017
----------------------------
Modified: code/trunk/src/pcre2_jit_match.c
===================================================================
--- code/trunk/src/pcre2_jit_match.c 2017-11-16 17:44:50 UTC (rev 883)
+++ code/trunk/src/pcre2_jit_match.c 2017-11-23 07:54:39 UTC (rev 884)
@@ -118,7 +118,7 @@
else if ((options & PCRE2_PARTIAL_SOFT) != 0)
index = 1;
-if (functions->executable_funcs[index] == NULL)
+if (functions->executable_funcs == NULL || functions->executable_funcs[index] == NULL)
return PCRE2_ERROR_JIT_BADOPTION;
/* Sanity checks should be handled by pcre_exec. */