|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-02-21 12:01 UTC] yu at hoaxster dot net
Description: ------------ php_strip_whitespace causes segmentation fault while parsing __CLASS__. Test script: --------------- # cat test.php <?php __CLASS__ ?> # php -r 'php_strip_whitespace(getcwd()."/test.php");' Actual result: -------------- [Fri Feb 21 20:57:50 2014] Script: '-' --------------------------------------- /var/tmp/php-build/source/5.6.0alpha2/Zend/zend_highlight.c(214) : Block 0x10781c048 status: Invalid pointer: ((size=0x0002b5a5) != (next.prev=0x444d4f4400000001)) Invalid pointer: ((prev=0x00000001) != (prev.size=0x0002b5a5)) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 11:00:01 2025 UTC |
This is a bit strange ... diff --git a/Zend/zend_highlight.c b/Zend/zend_highlight.c index e4f8d02..b961104 100644 --- a/Zend/zend_highlight.c +++ b/Zend/zend_highlight.c @@ -211,7 +211,8 @@ ZEND_API void zend_strip(TSRMLS_D) break; default: - efree(token.value.str.val); + if (token.value.str.len) + efree(token.value.str.val); break; } } You wouldn't think this is necessary, so I won't submit this as a patch ... Just a note really, I couldn't make this segfault but there is a call to efree an invalid pointer. /me leaves this for someone else who has more of a clue ...