com php-src: Backport fix for uaf during pcre jit fallback: ext/pcre/pcre2lib/pcre2_jit_compile.c

From: Date: Mon, 07 Oct 2019 11:23:56 +0000
Subject: com php-src: Backport fix for uaf during pcre jit fallback: ext/pcre/pcre2lib/pcre2_jit_compile.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-108764@lists.php.net to get a copy of this message
Commit: ab61d5caf926e080fb5729dbef9ae091169cec88 Author: Nikita Popov <nikita.ppv@gmail.com> Mon, 7 Oct 2019 13:21:36 +0200 Parents: 3322c78a889e278b738b2c483b4d09d0a9127369 Branches: PHP-7.3 PHP-7.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ab61d5caf926e080fb5729dbef9ae091169cec88 Log: Backport fix for uaf during pcre jit fallback Backports parts of https://vcs.pcre.org/pcre2?view=revision&revision=1175 fixing https://bugs.exim.org/show_bug.cgi?id=2453. Changed paths: M ext/pcre/pcre2lib/pcre2_jit_compile.c Diff: diff --git a/ext/pcre/pcre2lib/pcre2_jit_compile.c b/ext/pcre/pcre2lib/pcre2_jit_compile.c index c491be2917d..6c317b68d19 100644 --- a/ext/pcre/pcre2lib/pcre2_jit_compile.c +++ b/ext/pcre/pcre2lib/pcre2_jit_compile.c @@ -12321,7 +12321,7 @@ if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler))) sljit_free_compiler(compiler); SLJIT_FREE(common->optimized_cbracket, allocator_data); SLJIT_FREE(common->private_data_ptrs, allocator_data); - PRIV(jit_free_rodata)(common->read_only_data_head, compiler->allocator_data); + PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); return PCRE2_ERROR_NOMEMORY; } @@ -12375,7 +12375,7 @@ if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler))) sljit_free_compiler(compiler); SLJIT_FREE(common->optimized_cbracket, allocator_data); SLJIT_FREE(common->private_data_ptrs, allocator_data); - PRIV(jit_free_rodata)(common->read_only_data_head, compiler->allocator_data); + PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); return PCRE2_ERROR_NOMEMORY; } @@ -12464,7 +12464,7 @@ while (common->currententry != NULL) sljit_free_compiler(compiler); SLJIT_FREE(common->optimized_cbracket, allocator_data); SLJIT_FREE(common->private_data_ptrs, allocator_data); - PRIV(jit_free_rodata)(common->read_only_data_head, compiler->allocator_data); + PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); return PCRE2_ERROR_NOMEMORY; } flush_stubs(common); @@ -12589,7 +12589,7 @@ while (label_addr != NULL) sljit_free_compiler(compiler); if (executable_func == NULL) { - PRIV(jit_free_rodata)(common->read_only_data_head, compiler->allocator_data); + PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); return PCRE2_ERROR_NOMEMORY; } @@ -12604,7 +12604,7 @@ else /* This case is highly unlikely since we just recently freed a lot of memory. Not impossible though. */ sljit_free_code(executable_func); - PRIV(jit_free_rodata)(common->read_only_data_head, compiler->allocator_data); + PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); return PCRE2_ERROR_NOMEMORY; } memset(functions, 0, sizeof(executable_functions));

« previous php.cvs (#108764) next »