felipe Sun, 01 Aug 2010 17:34:09 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=301765
Log: - Fixed bug #52468 (wddx_deserialize corrupts integer field value when left empty) Bug: http://bugs.php.net/52468 (Open) wddx_deserialize corrupts integer field value when left empty Changed paths: U php/php-src/branches/PHP_5_3/NEWS A php/php-src/branches/PHP_5_3/ext/wddx/tests/bug52468.phpt U php/php-src/branches/PHP_5_3/ext/wddx/wddx.c A php/php-src/trunk/ext/wddx/tests/bug52468.phpt U php/php-src/trunk/ext/wddx/wddx.c Modified: php/php-src/branches/PHP_5_3/NEWS =================================================================== --- php/php-src/branches/PHP_5_3/NEWS 2010-08-01 16:24:42 UTC (rev 301764) +++ php/php-src/branches/PHP_5_3/NEWS 2010-08-01 17:34:09 UTC (rev 301765) @@ -6,6 +6,8 @@ - Fixed bug #52487 (PDO::FETCH_INTO leaks memory). (Felipe) - Fixed bug #52484 (__set() ignores setting properties with empty names). (Felipe) +- Fixed bug #52468 (wddx_deserialize corrupts integer field value when left + empty). (Felipe) - Fixed bug #52436 (Compile error if systems do not have stdint.h) (Sriram Natarajan) Added: php/php-src/branches/PHP_5_3/ext/wddx/tests/bug52468.phpt =================================================================== --- php/php-src/branches/PHP_5_3/ext/wddx/tests/bug52468.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/wddx/tests/bug52468.phpt 2010-08-01 17:34:09 UTC (rev 301765) @@ -0,0 +1,20 @@ +--TEST-- +Bug #52468 (wddx_deserialize corrupts integer field value when left empty) +--FILE-- +<?php + +$message = "<wddxPacket version='1.0'><header><comment>my_command</comment></header><data><struct><var name='handle'><number></number></var></struct></data></wddxPacket>"; + +print_r(wddx_deserialize($message)); +print_r(wddx_deserialize($message)); + +?> +--EXPECT-- +Array +( + [handle] => 0 +) +Array +( + [handle] => 0 +) Property changes on: php/php-src/branches/PHP_5_3/ext/wddx/tests/bug52468.phpt ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native Modified: php/php-src/branches/PHP_5_3/ext/wddx/wddx.c =================================================================== --- php/php-src/branches/PHP_5_3/ext/wddx/wddx.c 2010-08-01 16:24:42 UTC (rev 301764) +++ php/php-src/branches/PHP_5_3/ext/wddx/wddx.c 2010-08-01 17:34:09 UTC (rev 301765) @@ -785,6 +785,7 @@ ALLOC_ZVAL(ent.data); INIT_PZVAL(ent.data); Z_TYPE_P(ent.data) = IS_LONG; + Z_LVAL_P(ent.data) = 0; wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); } else if (!strcmp(name, EL_BOOLEAN)) { int i; Added: php/php-src/trunk/ext/wddx/tests/bug52468.phpt =================================================================== --- php/php-src/trunk/ext/wddx/tests/bug52468.phpt (rev 0) +++ php/php-src/trunk/ext/wddx/tests/bug52468.phpt 2010-08-01 17:34:09 UTC (rev 301765) @@ -0,0 +1,20 @@ +--TEST-- +Bug #52468 (wddx_deserialize corrupts integer field value when left empty) +--FILE-- +<?php + +$message = "<wddxPacket version='1.0'><header><comment>my_command</comment></header><data><struct><var name='handle'><number></number></var></struct></data></wddxPacket>"; + +print_r(wddx_deserialize($message)); +print_r(wddx_deserialize($message)); + +?> +--EXPECT-- +Array +( + [handle] => 0 +) +Array +( + [handle] => 0 +) Property changes on: php/php-src/trunk/ext/wddx/tests/bug52468.phpt ___________________________________________________________________ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native Modified: php/php-src/trunk/ext/wddx/wddx.c =================================================================== --- php/php-src/trunk/ext/wddx/wddx.c 2010-08-01 16:24:42 UTC (rev 301764) +++ php/php-src/trunk/ext/wddx/wddx.c 2010-08-01 17:34:09 UTC (rev 301765) @@ -785,6 +785,7 @@ ALLOC_ZVAL(ent.data); INIT_PZVAL(ent.data); Z_TYPE_P(ent.data) = IS_LONG; + Z_LVAL_P(ent.data) = 0; wddx_stack_push((wddx_stack *)stack, &ent, sizeof(st_entry)); } else if (!strcmp(name, EL_BOOLEAN)) { int i;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
