Skip to content

Commit ae5d862

Browse files
committed
Merge branch 'PHP-5.5'
* PHP-5.5: Fixed bug #63874 (Segfaul if php_strip_whitespace has heredoc)
2 parents 3b022e5 + 8228597 commit ae5d862

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Zend/zend_highlight.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ ZEND_API void zend_strip(TSRMLS_D)
186186

187187
case T_END_HEREDOC:
188188
zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
189-
efree(token.value.str.val);
190189
/* read the following character, either newline or ; */
191190
if (lex_scan(&token TSRMLS_CC) != T_WHITESPACE) {
192191
zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
Bug #63874 (Segfault if php_strip_whitespace has heredoc)
3+
--FILE--
4+
<?php
5+
echo php_strip_whitespace(__FILE__);
6+
7+
return <<<A
8+
a
9+
A;
10+
?>
11+
--EXPECT--
12+
<?php
13+
echo php_strip_whitespace(__FILE__); return <<<A
14+
a
15+
A;
16+
?>

0 commit comments

Comments
 (0)