svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/main/streams/streams.c branches/PHP_5_4/main/streams/streams.c trunk/main/streams/streams.c
| From: | Gustavo André dos Santos Lopes | Date: | Tue, 05 Jul 2011 16:09:06 +0000 |
| Subject: | svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/main/streams/streams.c branches/PHP_5_4/main/streams/streams.c trunk/main/streams/streams.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-65411@lists.php.net to get a copy of this message | ||
cataphract Tue, 05 Jul 2011 16:09:06 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=312937
Log:
- Fixed bug #52935 (call exit in user_error_handler cause stream relate core).
Bug: https://bugs.php.net/52935 (Assigned) call exit in
user_error_handler cause stream relate core
Changed paths:
U php/php-src/branches/PHP_5_3/NEWS
U php/php-src/branches/PHP_5_3/main/streams/streams.c
U php/php-src/branches/PHP_5_4/main/streams/streams.c
U php/php-src/trunk/main/streams/streams.c
Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS 2011-07-05 14:12:01 UTC (rev 312936)
+++ php/php-src/branches/PHP_5_3/NEWS 2011-07-05 16:09:06 UTC (rev 312937)
@@ -5,6 +5,8 @@
. Fixed bug #53727 (Inconsistent behavior of is_subclass_of with interfaces)
(Ralph Schindler, Dmitry)
. Fixed buffer overflow on overlog salt in crypt(). (Clément LECIGNE, Stas)
+ . Fixed bug #52935 (call exit in user_error_handler cause stream relate
+ core). (Gustavo)
- PDO DBlib:
. Fixed bug #54329 (MSSql extension memory leak).
Modified: php/php-src/branches/PHP_5_3/main/streams/streams.c
===================================================================
--- php/php-src/branches/PHP_5_3/main/streams/streams.c 2011-07-05 14:12:01 UTC (rev 312936)
+++ php/php-src/branches/PHP_5_3/main/streams/streams.c 2011-07-05 16:09:06 UTC (rev 312937)
@@ -154,6 +154,7 @@
char *tmp = estrdup(path);
char *msg;
int free_msg = 0;
+ php_stream_wrapper orig_wrapper;
if (wrapper) {
if (wrapper->err_count > 0) {
@@ -198,7 +199,16 @@
}
php_strip_url_passwd(tmp);
+ if (wrapper) {
+ /* see bug #52935 */
+ orig_wrapper = *wrapper;
+ wrapper->err_stack = NULL;
+ wrapper->err_count = 0;
+ }
php_error_docref1(NULL TSRMLS_CC, tmp, E_WARNING, "%s: %s", caption, msg);
+ if (wrapper) {
+ *wrapper = orig_wrapper;
+ }
efree(tmp);
if (free_msg) {
efree(msg);
Modified: php/php-src/branches/PHP_5_4/main/streams/streams.c
===================================================================
--- php/php-src/branches/PHP_5_4/main/streams/streams.c 2011-07-05 14:12:01 UTC (rev 312936)
+++ php/php-src/branches/PHP_5_4/main/streams/streams.c 2011-07-05 16:09:06 UTC (rev 312937)
@@ -163,6 +163,7 @@
char *tmp = estrdup(path);
char *msg;
int free_msg = 0;
+ php_stream_wrapper orig_wrapper;
if (wrapper) {
if (wrapper->err_count > 0) {
@@ -207,7 +208,16 @@
}
php_strip_url_passwd(tmp);
+ if (wrapper) {
+ /* see bug #52935 */
+ orig_wrapper = *wrapper;
+ wrapper->err_stack = NULL;
+ wrapper->err_count = 0;
+ }
php_error_docref1(NULL TSRMLS_CC, tmp, E_WARNING, "%s: %s", caption, msg);
+ if (wrapper) {
+ *wrapper = orig_wrapper;
+ }
efree(tmp);
if (free_msg) {
efree(msg);
Modified: php/php-src/trunk/main/streams/streams.c
===================================================================
--- php/php-src/trunk/main/streams/streams.c 2011-07-05 14:12:01 UTC (rev 312936)
+++ php/php-src/trunk/main/streams/streams.c 2011-07-05 16:09:06 UTC (rev 312937)
@@ -163,6 +163,7 @@
char *tmp = estrdup(path);
char *msg;
int free_msg = 0;
+ php_stream_wrapper orig_wrapper;
if (wrapper) {
if (wrapper->err_count > 0) {
@@ -207,7 +208,16 @@
}
php_strip_url_passwd(tmp);
+ if (wrapper) {
+ /* see bug #52935 */
+ orig_wrapper = *wrapper;
+ wrapper->err_stack = NULL;
+ wrapper->err_count = 0;
+ }
php_error_docref1(NULL TSRMLS_CC, tmp, E_WARNING, "%s: %s", caption, msg);
+ if (wrapper) {
+ *wrapper = orig_wrapper;
+ }
efree(tmp);
if (free_msg) {
efree(msg);