]> granicus.if.org Git - php/commitdiff
- Fixed bug #52935 (call exit in user_error_handler cause stream relate core).
authorGustavo André dos Santos Lopes <cataphract@php.net>
Tue, 5 Jul 2011 16:09:06 +0000 (16:09 +0000)
committerGustavo André dos Santos Lopes <cataphract@php.net>
Tue, 5 Jul 2011 16:09:06 +0000 (16:09 +0000)
NEWS
main/streams/streams.c

diff --git a/NEWS b/NEWS
index 7b9bc11edb96682fafd148ac9abc3227193db7ac..30e58fad7ac0c98faf8fdafe723c10f72f1c6a88 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ PHP                                                                        NEWS
   . 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).
index eb2eb07082ba8b12a4d6de453431801aa31f7f31..81adff8137f129de494be43f9f62f5edf47c438c 100755 (executable)
@@ -154,6 +154,7 @@ void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *
        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 @@ void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *
        }
 
        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);