com php-src: Fixed bug #73173: NEWS ext/wddx/tests/bug73173.phpt ext/wddx/wddx.c

From: Date: Sun, 25 Jun 2017 18:17:06 +0000
Subject: com php-src: Fixed bug #73173: NEWS ext/wddx/tests/bug73173.phpt ext/wddx/wddx.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-98220@lists.php.net to get a copy of this message
Commit: 604827b694aaf1ffcbd986043ba27642534f2ccf Author: Nikita Popov <nikita.ppv@gmail.com> Sun, 25 Jun 2017 20:14:58 +0200 Parents: cfee5116ddd472bc4575f4bcc92337f5d02c6882 Branches: PHP-7.0 PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=604827b694aaf1ffcbd986043ba27642534f2ccf Log: Fixed bug #73173 Patch by tloi at fortinet dot com. Bugs: https://bugs.php.net/73173 Changed paths: M NEWS A ext/wddx/tests/bug73173.phpt M ext/wddx/wddx.c Diff: diff --git a/NEWS b/NEWS index f215ab8...b790a26 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,10 @@ PHP NEWS - SPL: . Fixed bug #73471 (PHP freezes with AppendIterator). (jhdxr) +- Wddx: + . Fixed bug #73173 (huge memleak when wddx_unserialize). + (tloi at fortinet dot com) + - zlib: . Fixed bug #73944 (dictionary option of inflate_init() does not work). (wapmorgan) diff --git a/ext/wddx/tests/bug73173.phpt b/ext/wddx/tests/bug73173.phpt new file mode 100644 index 0000000..00fe56e --- /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 4040ed6..25d7dea 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; } /* }}} */

« previous php.cvs (#98220) next »