[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-cvs
Subject:    [PHP-CVS] com php-src: Fixed bug #75735 ([embed SAPI] Segmentation fault in =?UTF-8?Q?sapi=5Fregiste
From:       Xinchen Hui <laruence () php ! net>
Date:       2017-12-27 4:51:50
Message-ID: php-mail-76524b7d911a3e3fed830ce29d2a68432093073944 () git ! php ! net
[Download RAW message or body]

Commit:    dc3822c3431ec3229ad439c3e4e4b956218777af
Author:    Xinchen Hui <laruence@gmail.com>         Wed, 27 Dec 2017 12:51:50 +0800
Parents:   9cafc33ba3dcb15d062e9a26f86dd294a6f89431
Branches:  PHP-7.1 PHP-7.2 master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=dc3822c3431ec3229ad439c3e4e4b956218777af

Log:
Fixed bug #75735 ([embed SAPI] Segmentation fault in sapi_register_post_entry)

Bugs:
https://bugs.php.net/75735

Changed paths:
  M  NEWS
  M  TSRM/TSRM.h
  M  sapi/embed/php_embed.c


Diff:
diff --git a/NEWS b/NEWS
index 478d889..9d44be5 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,10 @@ PHP                                                                        NEWS
   . Fixed bug #75671 (pg_version() crashes when called on a connection to
     cockroach). (magicaltux at gmail dot com)
 
+- SAPI:
+  . Fixed bug #75735 ([embed SAPI] Segmentation fault in
+    sapi_register_post_entry). (Laruence)
+
 - SOAP:
   . Fixed bug #70469 (SoapClient generates E_ERROR even if exceptions=1 is
     used). (Anton Artamonov)
diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h
index f9bb241..458843a 100644
--- a/TSRM/TSRM.h
+++ b/TSRM/TSRM.h
@@ -174,8 +174,10 @@ TSRM_API void *tsrm_get_ls_cache(void);
 #define TSRMLS_CACHE_DEFINE() TSRM_TLS void *TSRMLS_CACHE = NULL;
 #if ZEND_DEBUG
 #define TSRMLS_CACHE_UPDATE() TSRMLS_CACHE = tsrm_get_ls_cache()
+#define TSRMLS_CACHE_RESET()
 #else
 #define TSRMLS_CACHE_UPDATE() if (!TSRMLS_CACHE) TSRMLS_CACHE = tsrm_get_ls_cache()
+#define TSRMLS_CACHE_RESET()  TSRMLS_CACHE = NULL
 #endif
 #define TSRMLS_CACHE _tsrm_ls_cache
 
diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c
index e444610..e2a27a1 100644
--- a/sapi/embed/php_embed.c
+++ b/sapi/embed/php_embed.c
@@ -227,6 +227,7 @@ EMBED_SAPI_API void php_embed_shutdown(void)
 	sapi_shutdown();
 #ifdef ZTS
     tsrm_shutdown();
+	TSRMLS_CACHE_RESET();
 #endif
 	if (php_embed_module.ini_entries) {
 		free(php_embed_module.ini_entries);


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic