diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2017-06-25 20:14:58 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2017-06-25 20:17:06 +0200 |
commit | 604827b694aaf1ffcbd986043ba27642534f2ccf (patch) | |
tree | 4b9b3e0880004630178ab3ae7e9169a2f50c2e83 /ext/wddx | |
parent | cfee5116ddd472bc4575f4bcc92337f5d02c6882 (diff) | |
download | php-git-604827b694aaf1ffcbd986043ba27642534f2ccf.tar.gz |
Fixed bug #73173
Patch by tloi at fortinet dot com.
Diffstat (limited to 'ext/wddx')
-rw-r--r-- | ext/wddx/tests/bug73173.phpt | 25 | ||||
-rw-r--r-- | ext/wddx/wddx.c | 3 |
2 files changed, 28 insertions, 0 deletions
diff --git a/ext/wddx/tests/bug73173.phpt b/ext/wddx/tests/bug73173.phpt new file mode 100644 index 0000000000..00fe56e4b0 --- /dev/null +++ b/ext/wddx/tests/bug73173.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #73173: huge memleak when wddx_unserialize +--SKIPIF-- +<?php if (!extension_loaded("wddx")) print "skip"; ?> +--FILE-- +<?php + +$xml=<<<XML +<?xml version='1.0'?> +<!DOCTYPE wddxPacket SYSTEM 'wddx_0100.dtd'> +<wddxPacket> +<var name=" +XML; + +$xml .= str_repeat('F',0x80000); + +$xml .= <<<XML +"> +</wddxPacket> +XML; +var_dump(wddx_deserialize($xml)); + +?> +--EXPECT-- +NULL diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c index 4040ed61c6..25d7deae17 100644 --- a/ext/wddx/wddx.c +++ b/ext/wddx/wddx.c @@ -241,6 +241,9 @@ static int wddx_stack_destroy(wddx_stack *stack) } efree(stack->elements); } + if (stack->varname) { + efree(stack->varname); + } return SUCCESS; } /* }}} */ |