summaryrefslogtreecommitdiff
path: root/ext/wddx
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:35:13 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:35:13 -0400
commit0a36161e13484a99ccf69bb38f206462d27cc6d6 (patch)
treed5107db4b7369603ac7c753829e8972ee74949f7 /ext/wddx
parentce7edc9b3c7370f32fec0bc7a8ec3e29ed9a5f61 (diff)
downloadphp-0a36161e13484a99ccf69bb38f206462d27cc6d6.tar.gz
Imported Upstream version 5.1.2upstream/5.1.2
Diffstat (limited to 'ext/wddx')
-rw-r--r--ext/wddx/config.m44
-rw-r--r--ext/wddx/php_wddx.h8
-rw-r--r--ext/wddx/php_wddx_api.h8
-rw-r--r--ext/wddx/tests/001.phpt2
-rwxr-xr-xext/wddx/tests/bug27287.phpt2
-rwxr-xr-xext/wddx/tests/bug34306.phpt2
-rwxr-xr-xext/wddx/tests/bug35410.phpt76
-rwxr-xr-xext/wddx/tests/bug35410_64bit.phpt76
-rw-r--r--ext/wddx/wddx.c14
9 files changed, 177 insertions, 15 deletions
diff --git a/ext/wddx/config.m4 b/ext/wddx/config.m4
index 0c5228b0a..2d0e4eff2 100644
--- a/ext/wddx/config.m4
+++ b/ext/wddx/config.m4
@@ -1,12 +1,12 @@
dnl
-dnl $Id: config.m4,v 1.11 2005/05/29 23:16:45 sniper Exp $
+dnl $Id: config.m4,v 1.11.2.1 2005/12/21 14:22:26 sniper Exp $
dnl
PHP_ARG_ENABLE(wddx,whether to enable WDDX support,
[ --enable-wddx Enable WDDX support])
if test "$PHP_WDDX" != "no"; then
- if test "$ext_shared" != "yes" && test "$enable_xml" = "no"; then
+ if test "$ext_shared" != "yes" && (test "$enable_xml" = "no" || test "${enable_xml+set}" != "set"); then
AC_MSG_WARN(Activating XML)
enable_xml=yes
fi
diff --git a/ext/wddx/php_wddx.h b/ext/wddx/php_wddx.h
index c774654fa..e05384023 100644
--- a/ext/wddx/php_wddx.h
+++ b/ext/wddx/php_wddx.h
@@ -2,12 +2,12 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
+ | Copyright (c) 1997-2006 The PHP Group |
+----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
+ | This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
+ | http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_wddx.h,v 1.18 2005/08/03 14:08:20 sniper Exp $ */
+/* $Id: php_wddx.h,v 1.18.2.1 2006/01/01 12:50:16 sniper Exp $ */
#ifndef PHP_WDDX_H
#define PHP_WDDX_H
diff --git a/ext/wddx/php_wddx_api.h b/ext/wddx/php_wddx_api.h
index 3a5ebda2f..496b3a77a 100644
--- a/ext/wddx/php_wddx_api.h
+++ b/ext/wddx/php_wddx_api.h
@@ -2,12 +2,12 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
+ | Copyright (c) 1997-2006 The PHP Group |
+----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
+ | This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
+ | http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_wddx_api.h,v 1.23.2.2 2005/10/06 18:48:19 rrichards Exp $ */
+/* $Id: php_wddx_api.h,v 1.23.2.3 2006/01/01 12:50:16 sniper Exp $ */
#ifndef PHP_WDDX_API_H
#define PHP_WDDX_API_H
diff --git a/ext/wddx/tests/001.phpt b/ext/wddx/tests/001.phpt
index 3aae14853..ffca63cd9 100644
--- a/ext/wddx/tests/001.phpt
+++ b/ext/wddx/tests/001.phpt
@@ -1,5 +1,7 @@
--TEST--
wddx deserialization test
+--SKIPIF--
+<?php if (!extension_loaded("wddx")) print "skip"; ?>
--FILE--
<?php
$path = dirname(__FILE__);
diff --git a/ext/wddx/tests/bug27287.phpt b/ext/wddx/tests/bug27287.phpt
index 3183fbc2a..72ac317aa 100755
--- a/ext/wddx/tests/bug27287.phpt
+++ b/ext/wddx/tests/bug27287.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #27287 (segfault with deserializing object data)
+--SKIPIF--
+<?php if (!extension_loaded("wddx")) print "skip"; ?>
--FILE--
<?php
diff --git a/ext/wddx/tests/bug34306.phpt b/ext/wddx/tests/bug34306.phpt
index 2212dad91..5f1a0df72 100755
--- a/ext/wddx/tests/bug34306.phpt
+++ b/ext/wddx/tests/bug34306.phpt
@@ -1,5 +1,7 @@
--TEST--
#34306 (wddx_serialize_value() crashes with long array keys)
+--SKIPIF--
+<?php if (!extension_loaded("wddx")) print "skip"; ?>
--FILE--
<?php
diff --git a/ext/wddx/tests/bug35410.phpt b/ext/wddx/tests/bug35410.phpt
new file mode 100755
index 000000000..3b4b9b62c
--- /dev/null
+++ b/ext/wddx/tests/bug35410.phpt
@@ -0,0 +1,76 @@
+--TEST--
+#35410 (wddx_deserialize() doesn't handle large ints as keys properly)
+--SKIPIF--
+<?php
+ if (!extension_loaded("wddx")) print "skip";
+ if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
+?>
+--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"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/ext/wddx/tests/bug35410_64bit.phpt b/ext/wddx/tests/bug35410_64bit.phpt
new file mode 100755
index 000000000..15377b175
--- /dev/null
+++ b/ext/wddx/tests/bug35410_64bit.phpt
@@ -0,0 +1,76 @@
+--TEST--
+#35410 (wddx_deserialize() doesn't handle large ints as keys properly)
+--SKIPIF--
+<?php
+ if (!extension_loaded("wddx")) print "skip";
+ if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--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"
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index e801d60a6..d274f8519 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -2,12 +2,12 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
+ | Copyright (c) 1997-2006 The PHP Group |
+----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
+ | This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
+ | http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: wddx.c,v 1.119.2.5 2005/10/06 18:48:19 rrichards Exp $ */
+/* $Id: wddx.c,v 1.119.2.8 2006/01/01 12:50:16 sniper Exp $ */
#include "php.h"
@@ -99,7 +99,7 @@ static void php_wddx_process_data(void *user_data, const XML_Char *s, int len);
/* {{{ wddx_functions[]
*/
-function_entry wddx_functions[] = {
+zend_function_entry wddx_functions[] = {
PHP_FE(wddx_serialize_value, NULL)
PHP_FE(wddx_serialize_vars, NULL)
PHP_FE(wddx_packet_start, NULL)
@@ -1005,11 +1005,15 @@ static void php_wddx_pop_element(void *user_data, const XML_Char *name)
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);
}
}