com php-src: Merge branch 'PHP-7.1' into PHP-7.2: ext/pcre/php _pcre.c
| From: | Anatol Belski | Date: | Tue, 05 Dec 2017 17:34:39 +0000 |
| Subject: | com php-src: Merge branch 'PHP-7.1' into PHP-7.2: ext/pcre/php _pcre.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100502@lists.php.net to get a copy of this message | ||
Commit: d4af2046372dd33e2364c6862ada3a9333f75907
Author: Anatol Belski <ab@php.net> Tue, 5 Dec 2017 18:34:39 +0100
Parents: 75a2ee7f7bad4d3bc7bc60c181eabcc6d58c7937 092fd44474676857359153c859e0cb300720d80a
Branches: PHP-7.2 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d4af2046372dd33e2364c6862ada3a9333f75907
Log:
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
Fix use after free revealed by phpdbg
Changed paths:
MM ext/pcre/php_pcre.c
Diff:
diff --cc ext/pcre/php_pcre.c
index 64db5da,a743f30..5ec7f4d
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@@ -70,8 -69,8 +70,8 @@@ ZEND_TLS pcre_jit_stack *jit_stack = NU
#endif
#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); pcre_mt = NULL;
+#define php_pcre_mutex_alloc() if (tsrm_is_main_thread() && !pcre_mt) pcre_mt =
tsrm_mutex_alloc();
- #define php_pcre_mutex_free() if (tsrm_is_main_thread() && pcre_mt)
tsrm_mutex_free(pcre_mt);
++#define php_pcre_mutex_free() if (tsrm_is_main_thread() && 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