Skip to content

Commit

Permalink
Fixed bug #73173
Browse files Browse the repository at this point in the history
Patch by tloi at fortinet dot com.
  • Loading branch information
nikic committed Jun 25, 2017
1 parent cfee511 commit 604827b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
25 changes: 25 additions & 0 deletions ext/wddx/tests/bug73173.phpt
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions ext/wddx/wddx.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ static int wddx_stack_destroy(wddx_stack *stack)
}
efree(stack->elements);
}
if (stack->varname) {
efree(stack->varname);
}
return SUCCESS;
}
/* }}} */
Expand Down

0 comments on commit 604827b

Please sign in to comment.