Fix the too early access of the fields of a compiled pattern in JIT.

This commit is contained in:
Zoltán Herczeg 2019-12-07 16:00:53 +00:00
parent 2632526c67
commit 880aac5dda
2 changed files with 8 additions and 5 deletions

View File

@ -8,6 +8,9 @@ Version 10.35
2. Fix ARMv5 JIT improper handling of labels right after a constant pool. 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 Version 10.34 21-November-2019
------------------------------ ------------------------------

View File

@ -13742,11 +13742,6 @@ pcre2_jit_compile(pcre2_code *code, uint32_t options)
{ {
pcre2_real_code *re = (pcre2_real_code *)code; 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) if (code == NULL)
return PCRE2_ERROR_NULL; return PCRE2_ERROR_NULL;
@ -13779,6 +13774,11 @@ actions are needed:
avoid compiler warnings. 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 ((options & PCRE2_JIT_INVALID_UTF) != 0)
{ {
if ((re->overall_options & PCRE2_MATCH_INVALID_UTF) == 0) if ((re->overall_options & PCRE2_MATCH_INVALID_UTF) == 0)