com php-src: Fix use after free revealed by phpdbg: ext/pcre/php_pcre.c
| From: | Anatol Belski | Date: | Tue, 05 Dec 2017 17:32:32 +0000 |
| Subject: | com php-src: Fix use after free revealed by phpdbg: ext/pcre/php_pcre.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100503@lists.php.net to get a copy of this message | ||
Commit: 092fd44474676857359153c859e0cb300720d80a
Author: Anatol Belski <ab@php.net> Tue, 5 Dec 2017 18:32:32 +0100
Parents: 31b2b14a712f9a8e6beddec4522e12484259422b
Branches: PHP-7.1 PHP-7.2 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=092fd44474676857359153c859e0cb300720d80a
Log:
Fix use after free revealed by phpdbg
Changed paths:
M ext/pcre/php_pcre.c
Diff:
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 42e577e..a743f30 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -70,7 +70,7 @@ ZEND_TLS pcre_jit_stack *jit_stack = NULL;
#if defined(ZTS) && defined(HAVE_PCRE_JIT_SUPPORT)
static MUTEX_T pcre_mt = NULL;
#define php_pcre_mutex_alloc() if (!pcre_mt) pcre_mt = tsrm_mutex_alloc();
-#define php_pcre_mutex_free() if (pcre_mt) tsrm_mutex_free(pcre_mt);
+#define php_pcre_mutex_free() if (pcre_mt) tsrm_mutex_free(pcre_mt); pcre_mt = NULL;
#define php_pcre_mutex_lock() tsrm_mutex_lock(pcre_mt);
#define php_pcre_mutex_unlock() tsrm_mutex_unlock(pcre_mt);
#else