[Pcre-svn] [1192] code/trunk: Fix the too early access of th…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [1192] code/trunk: Fix the too early access of the fields of a compiled pattern in JIT.
Revision: 1192
          http://www.exim.org/viewvc/pcre2?view=rev&revision=1192
Author:   zherczeg
Date:     2019-12-07 16:00:53 +0000 (Sat, 07 Dec 2019)
Log Message:
-----------
Fix the too early access of the fields of a compiled pattern in JIT.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/src/pcre2_jit_compile.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2019-11-29 11:03:10 UTC (rev 1191)
+++ code/trunk/ChangeLog    2019-12-07 16:00:53 UTC (rev 1192)
@@ -8,7 +8,10 @@


2. Fix ARMv5 JIT improper handling of labels right after a constant pool.

+3. A JIT bug is fixed which allowed to read the fields of the compiled
+pattern before its existence is checked.

+
Version 10.34 21-November-2019
------------------------------


Modified: code/trunk/src/pcre2_jit_compile.c
===================================================================
--- code/trunk/src/pcre2_jit_compile.c    2019-11-29 11:03:10 UTC (rev 1191)
+++ code/trunk/src/pcre2_jit_compile.c    2019-12-07 16:00:53 UTC (rev 1192)
@@ -13742,11 +13742,6 @@
 {
 pcre2_real_code *re = (pcre2_real_code *)code;


-#ifdef SUPPORT_JIT
-executable_functions *functions = (executable_functions *)re->executable_jit;
-static int executable_allocator_is_working = 0;
-#endif
-
if (code == NULL)
return PCRE2_ERROR_NULL;

@@ -13779,6 +13774,11 @@
      avoid compiler warnings.
 */


+#ifdef SUPPORT_JIT
+executable_functions *functions = (executable_functions *)re->executable_jit;
+static int executable_allocator_is_working = 0;
+#endif
+
if ((options & PCRE2_JIT_INVALID_UTF) != 0)
{
if ((re->overall_options & PCRE2_MATCH_INVALID_UTF) == 0)