iliaa Wed Feb 11 12:09:10 2004 EDT
Added files: (Branch: PHP_4_3)
/php-src/ext/standard/tests/file bug27183.phpt
Modified files:
/php-src NEWS
/php-src/main user_streams.c
Log:
Fixed bug #27183 (userland stream wrapper segfaults on stream_write).
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.560&r2=1.1247.2.561&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.560 php-src/NEWS:1.1247.2.561
--- php-src/NEWS:1.1247.2.560 Wed Feb 11 12:00:54 2004
+++ php-src/NEWS Wed Feb 11 12:09:08 2004
@@ -3,6 +3,8 @@
?? Feb 2004, Version 4.3.5
- Fixed bug #27196 (Missing content_length initialization in apache 2 sapis).
(Ilia, pdoru at kappa dot ro)
+- Fixed bug #27183 (userland stream wrapper segfaults on stream_write).
+ (Moriyoshi)
- Fixed bug #27175 (tzset() is not being called by PHP on startup).
(Ilia, sagawa at sohgoh dot net)
- Fixed bug #27172 (Possible floating point exception in gmp_powm()). (Ilia)
http://cvs.php.net/diff.php/php-src/main/user_streams.c?r1=1.29.2.2&r2=1.29.2.3&ty=u
Index: php-src/main/user_streams.c
diff -u php-src/main/user_streams.c:1.29.2.2 php-src/main/user_streams.c:1.29.2.3
--- php-src/main/user_streams.c:1.29.2.2 Thu May 29 16:24:00 2003
+++ php-src/main/user_streams.c Wed Feb 11 12:09:09 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: user_streams.c,v 1.29.2.2 2003/05/29 20:24:00 hholzgra Exp $ */
+/* $Id: user_streams.c,v 1.29.2.3 2004/02/11 17:09:09 iliaa Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -382,15 +382,15 @@
int call_result;
php_userstream_data_t *us = (php_userstream_data_t *)stream->abstract;
zval **args[1];
- zval zbuff, *zbufptr;
+ zval *zbufptr;
size_t didwrite = 0;
assert(us != NULL);
ZVAL_STRINGL(&func_name, USERSTREAM_WRITE, sizeof(USERSTREAM_WRITE)-1, 0);
- ZVAL_STRINGL(&zbuff, (char*)buf, count, 0);
- zbufptr = &zbuff;
+ MAKE_STD_ZVAL(zbufptr);
+ ZVAL_STRINGL(zbufptr, (char*)buf, count, 1);
args[0] = &zbufptr;
call_result = call_user_function_ex(NULL,
@@ -400,6 +400,8 @@
1, args,
0, NULL TSRMLS_CC);
+ zval_ptr_dtor(&zbufptr);
+
didwrite = 0;
if (call_result == SUCCESS && retval != NULL) {
convert_to_long(retval);
http://cvs.php.net/co.php/php-src/ext/standard/tests/file/bug27183.phpt?r=1.1&p=1
Index: php-src/ext/standard/tests/file/bug27183.phpt
+++ php-src/ext/standard/tests/file/bug27183.phpt
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php