From: Nikita Popov Date: Wed, 2 Jul 2014 15:33:31 +0000 (+0200) Subject: Fix bug #67497: eval with parse error causes segfault in generator X-Git-Tag: php-5.5.15RC1~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d9ebd0f3d696e42d7c7bd2b0176414534aed0ef1;p=php Fix bug #67497: eval with parse error causes segfault in generator --- diff --git a/NEWS b/NEWS index 4a848548ab..9bfa384e82 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,8 @@ PHP NEWS match). (Bob) . Fixed bug #67091 (make install fails to install libphp5.so on FreeBSD 10.0). (Ferenc) + . Fixed buf #67497 (eval with parse error causes segmentation fault in + generator). (Nikita) - CLI server: . Implemented FR #67429 (CLI server is missing some new HTTP response codes). diff --git a/Zend/tests/generators/bug67497.phpt b/Zend/tests/generators/bug67497.phpt new file mode 100644 index 0000000000..483857b96c --- /dev/null +++ b/Zend/tests/generators/bug67497.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #67467: eval with parse error causes segmentation fault in generator +--FILE-- +next(); + +?> +===DONE=== +--EXPECT-- +===DONE=== diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index a5313dc1a3..b9722b45a0 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -125,6 +125,7 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished /* A fatal error / die occurred during the generator execution. Trying to clean * up the stack may not be safe in this case. */ if (CG(unclean_shutdown)) { + generator->execute_data = NULL; return; }