summaryrefslogtreecommitdiff
path: root/ext/wddx/tests
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2016-08-04 00:17:42 -0700
committerAnatol Belski <ab@php.net>2016-08-16 23:36:14 +0200
commite3829b88694460a2e5af10ad5eee9966fa55e589 (patch)
tree1878f7f1403459713a69db12d362b865a14b8eff /ext/wddx/tests
parent24fb60ffe9d23a6af27d96b74a85f6a237bbd14a (diff)
downloadphp-git-e3829b88694460a2e5af10ad5eee9966fa55e589.tar.gz
Fix bug #72749: wddx_deserialize allows illegal memory access
(cherry picked from commit 659a21dc20f0b64dafd8cb16573059d3b45cce6b) Conflicts: ext/wddx/wddx.c
Diffstat (limited to 'ext/wddx/tests')
-rw-r--r--ext/wddx/tests/bug72749.phpt34
1 files changed, 34 insertions, 0 deletions
diff --git a/ext/wddx/tests/bug72749.phpt b/ext/wddx/tests/bug72749.phpt
new file mode 100644
index 0000000000..ee17d0f229
--- /dev/null
+++ b/ext/wddx/tests/bug72749.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Bug #72749: wddx_deserialize allows illegal memory access
+--SKIPIF--
+<?php
+if (!extension_loaded('wddx')) {
+ die('skip. wddx not available');
+}
+?>
+--FILE--
+<?php
+$xml = <<<XML
+<?xml version='1.0'?>
+<!DOCTYPE wddxPacket SYSTEM 'wddx_0100.dtd'>
+<wddxPacket version='1.0'>
+<header/>
+ <data>
+ <struct>
+ <var name='aDateTime3'>
+ <dateTime>2\r2004-09-10T05:52:49+00</dateTime>
+ </var>
+ </struct>
+ </data>
+</wddxPacket>
+XML;
+
+$array = wddx_deserialize($xml);
+var_dump($array);
+?>
+--EXPECT--
+array(1) {
+ ["aDateTime3"]=>
+ string(24) "2
+2004-09-10T05:52:49+00"
+}