cvs: php-src /ext/wddx wddx.c /ext/wddx/tests bug35410.phpt

From: Date: Wed, 30 Nov 2005 18:13:17 +0000
Subject: cvs: php-src /ext/wddx wddx.c /ext/wddx/tests bug35410.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-35526@lists.php.net to get a copy of this message
iliaa Wed Nov 30 13:13:17 2005 EDT Modified files: /php-src/ext/wddx/tests bug35410.phpt /php-src/ext/wddx wddx.c Log: MFB51: Fixed bug #35410 (wddx_deserialize() doesn't handle large ints as keys properly). http://cvs.php.net/diff.php/php-src/ext/wddx/tests/bug35410.phpt?r1=1.1&r2=1.2&ty=u Index: php-src/ext/wddx/tests/bug35410.phpt diff -u /dev/null php-src/ext/wddx/tests/bug35410.phpt:1.2 --- /dev/null Wed Nov 30 13:13:17 2005 +++ php-src/ext/wddx/tests/bug35410.phpt Wed Nov 30 13:13:16 2005 @@ -0,0 +1,71 @@ +--TEST-- +#35410 (wddx_deserialize() doesn't handle large ints as keys properly) +--FILE-- +<?php +$wddx = <<<WDX +<wddxpacket version="1.0"> +<header> +<comment>Content Configuration File</comment> +</header> +<data> +<struct> +<var name="content_queries"> +<struct> +<var name="content_113300831086270200"> +<struct> +<var name="113301888545229100"> +<struct> +<var name="max"> +<number>10</number> +</var> +<var name="cache"> +<number>4</number> +</var> +<var name="order"> +<struct> +<var name="content_113300831086270200"> +<struct> +<var name="CMS_BUILD"> +<string>desc</string> +</var> +</struct> +</var> +</struct> +</var> +</struct> +</var> +</struct> +</var> +</struct> +</var> +</struct> +</data> +</wddxpacket> +WDX; + +var_dump(wddx_deserialize($wddx)); +?> +--EXPECT-- +array(1) { + ["content_queries"]=> + array(1) { + ["content_113300831086270200"]=> + array(1) { + ["113301888545229100"]=> + array(3) { + ["max"]=> + int(10) + ["cache"]=> + int(4) + ["order"]=> + array(1) { + ["content_113300831086270200"]=> + array(1) { + ["CMS_BUILD"]=> + string(4) "desc" + } + } + } + } + } +} http://cvs.php.net/diff.php/php-src/ext/wddx/wddx.c?r1=1.125&r2=1.126&ty=u Index: php-src/ext/wddx/wddx.c diff -u php-src/ext/wddx/wddx.c:1.125 php-src/ext/wddx/wddx.c:1.126 --- php-src/ext/wddx/wddx.c:1.125 Thu Oct 6 14:47:46 2005 +++ php-src/ext/wddx/wddx.c Wed Nov 30 13:13:17 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: wddx.c,v 1.125 2005/10/06 18:47:46 rrichards Exp $ */ +/* $Id: wddx.c,v 1.126 2005/11/30 18:13:17 iliaa Exp $ */ #include "php.h" @@ -1006,11 +1006,15 @@ switch (is_numeric_string(ent1->varname, strlen(ent1->varname), &l, &d, 0)) { case IS_DOUBLE: + if (d > INT_MAX) { + goto bigint; + } l = (long) d; case IS_LONG: zend_hash_index_update(target_hash, l, &ent1->data, sizeof(zval *), NULL); break; default: +bigint: zend_hash_update(target_hash,ent1->varname, strlen(ent1->varname)+1, &ent1->data, sizeof(zval *), NULL); } }

« previous php.cvs (#35526) next »