iliaa Wed Feb 18 14:49:18 2004 EDT
Added files: (Branch: PHP_4_3)
/php-src/ext/standard/tests/strings bug27295.phpt
Modified files:
/php-src NEWS
/php-src/ext/standard scanf.c
Log:
MFH: Fixed bug #27295 (memory leak inside sscanf()).
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.570&r2=1.1247.2.571&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.570 php-src/NEWS:1.1247.2.571
--- php-src/NEWS:1.1247.2.570 Tue Feb 17 16:30:55 2004
+++ php-src/NEWS Wed Feb 18 14:49:15 2004
@@ -1,6 +1,7 @@
PHP 4 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Feb 2004, Version 4.3.5
+- Fixed bug #27295 (memory leak inside sscanf()). (Ilia)
- Fixed bug #27293 (two crashes inside image2wbmp()). (Ilia)
- Fixed bug #27278 (*printf() functions treat arguments as if passed by
reference). (Ilia)
http://cvs.php.net/diff.php/php-src/ext/standard/scanf.c?r1=1.16.4.7&r2=1.16.4.8&ty=u
Index: php-src/ext/standard/scanf.c
diff -u php-src/ext/standard/scanf.c:1.16.4.7 php-src/ext/standard/scanf.c:1.16.4.8
--- php-src/ext/standard/scanf.c:1.16.4.7 Wed Sep 3 07:55:30 2003
+++ php-src/ext/standard/scanf.c Wed Feb 18 14:49:16 2004
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: scanf.c,v 1.16.4.7 2003/09/03 11:55:30 sniper Exp $ */
+/* $Id: scanf.c,v 1.16.4.8 2004/02/18 19:49:16 iliaa Exp $ */
/*
scanf.c --
@@ -923,7 +923,7 @@
if (!(flags & SCAN_SUPPRESS)) {
if (numVars) {
current = args[objIndex++];
- convert_to_string( *current );
+ zval_dtor( *current );
ZVAL_STRINGL( *current, string, end-string, 1);
} else {
add_index_stringl(*return_value, objIndex++, string, end-string,
1);
http://cvs.php.net/co.php/php-src/ext/standard/tests/strings/bug27295.phpt?r=1.1&p=1
Index: php-src/ext/standard/tests/strings/bug27295.phpt
+++ php-src/ext/standard/tests/strings/bug27295.phpt
--TEST--
Bug #27295 (memory leak inside sscanf())
--FILE--
<?php
$strings = array("foo = bar", "bar = foo");
foreach( $strings as $string )
{
sscanf( $string, "%s = %[^[]]", $var, $val );
echo "$var = $val\n";
}
?>
--EXPECT--
foo = bar
bar = foo
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php