mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Fixed bug #63874 (Segfaul if php_strip_whitespace has heredoc)
T_END_HEREDOC don't carry a token value anymore since commit 4cf90e06c
Bugfix by Nikita for bug #60097
This commit is contained in:
parent
f8a9a47e8c
commit
8228597ecc
3 changed files with 17 additions and 1 deletions
1
NEWS
1
NEWS
|
@ -3,6 +3,7 @@ PHP NEWS
|
||||||
?? ??? 201?, PHP 5.5.0 Alpha 3
|
?? ??? 201?, PHP 5.5.0 Alpha 3
|
||||||
|
|
||||||
- General improvements:
|
- General improvements:
|
||||||
|
. Fixed bug #63874 (Segfault if php_strip_whitespace has heredoc). (Pierrick)
|
||||||
. Fixed bug #63822 (Crash when using closures with ArrayAccess).
|
. Fixed bug #63822 (Crash when using closures with ArrayAccess).
|
||||||
(Nikita Popov)
|
(Nikita Popov)
|
||||||
. Add Generator::throw() method. (Nikita Popov)
|
. Add Generator::throw() method. (Nikita Popov)
|
||||||
|
|
|
@ -186,7 +186,6 @@ ZEND_API void zend_strip(TSRMLS_D)
|
||||||
|
|
||||||
case T_END_HEREDOC:
|
case T_END_HEREDOC:
|
||||||
zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
|
zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
|
||||||
efree(token.value.str.val);
|
|
||||||
/* read the following character, either newline or ; */
|
/* read the following character, either newline or ; */
|
||||||
if (lex_scan(&token TSRMLS_CC) != T_WHITESPACE) {
|
if (lex_scan(&token TSRMLS_CC) != T_WHITESPACE) {
|
||||||
zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
|
zend_write((char*)LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
|
||||||
|
|
16
ext/standard/tests/strings/bug63874.phpt
Normal file
16
ext/standard/tests/strings/bug63874.phpt
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #63874 (Segfault if php_strip_whitespace has heredoc)
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
echo php_strip_whitespace(__FILE__);
|
||||||
|
|
||||||
|
return <<<A
|
||||||
|
a
|
||||||
|
A;
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
<?php
|
||||||
|
echo php_strip_whitespace(__FILE__); return <<<A
|
||||||
|
a
|
||||||
|
A;
|
||||||
|
?>
|
Loading…
Add table
Add a link
Reference in a new issue