]> granicus.if.org Git - php/commitdiff
- MFH: Fixed bug #46388 (stream_notification_callback inside of object destroys objec...
authorFelipe Pena <felipe@php.net>
Sun, 26 Oct 2008 13:48:16 +0000 (13:48 +0000)
committerFelipe Pena <felipe@php.net>
Sun, 26 Oct 2008 13:48:16 +0000 (13:48 +0000)
NEWS
ext/standard/streamsfuncs.c

diff --git a/NEWS b/NEWS
index c85e177a82e7bcd3cafdecb83157f432edb71eb6..53327733b08c670db61261b3b8c6d2323df5194a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP                                                                        NEWS
 ?? Nov 2008, PHP 5.2.7RC3
 - Fixed bug #46389 (NetWare needs small patch for _timezone).
   (patch by guenter@php.net)
+- Fixed bug #46388 (stream_notification_callback inside of object destroys 
+  object variables). (Felipe)
 - Fixed bug #46381 (wrong $this passed to internal methods causes segfault). 
   (Tony)
 - Fixed bug #46082 (stream_set_blocking() can cause a crash in some
index 7dade984ac81f0882a8c5d0e4351ea5ddbefa22e..73a993b4d27f5255fcd1f75b451681a3588dcd58 100644 (file)
@@ -819,12 +819,13 @@ static void user_space_stream_notifier(php_stream_context *context, int notifyco
                INIT_ZVAL(zvs[i]);
                ps[i] = &zvs[i];
                ptps[i] = &ps[i];
+               MAKE_STD_ZVAL(ps[i]);
        }
                
        ZVAL_LONG(ps[0], notifycode);
        ZVAL_LONG(ps[1], severity);
        if (xmsg) {
-               ZVAL_STRING(ps[2], xmsg, 0);
+               ZVAL_STRING(ps[2], xmsg, 1);
        } else {
                ZVAL_NULL(ps[2]);
        }
@@ -835,6 +836,9 @@ static void user_space_stream_notifier(php_stream_context *context, int notifyco
        if (FAILURE == call_user_function_ex(EG(function_table), NULL, callback, &retval, 6, ptps, 0, NULL TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call user notifier");
        }
+       for (i = 0; i < 6; i++) {
+               zval_ptr_dtor(&ps[i]);
+       }
        if (retval) {
                zval_ptr_dtor(&retval);
        }