summaryrefslogtreecommitdiff
path: root/Zend/zend_generators.c
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2017-07-22 11:14:00 +0200
committerBob Weinand <bobwei9@hotmail.com>2017-07-22 11:14:00 +0200
commitbad5d0d6c56e078502b21ebdbf829b7a1c9b3bd3 (patch)
tree5965df013f257d502d424d0340775f1bbfe6d66f /Zend/zend_generators.c
parente405ff59f9e5873a3aa8dc6b7175708d424007b9 (diff)
downloadphp-git-bad5d0d6c56e078502b21ebdbf829b7a1c9b3bd3.tar.gz
Fixed bug #74954 (null deref and segfault in zend_generator_resume())
Diffstat (limited to 'Zend/zend_generators.c')
-rw-r--r--Zend/zend_generators.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c
index fd09831080..37faca1f00 100644
--- a/Zend/zend_generators.c
+++ b/Zend/zend_generators.c
@@ -644,15 +644,13 @@ failure:
ZEND_API void zend_generator_resume(zend_generator *orig_generator) /* {{{ */
{
- zend_generator *generator;
+ zend_generator *generator = zend_generator_get_current(orig_generator);
/* The generator is already closed, thus can't resume */
- if (UNEXPECTED(!orig_generator->execute_data)) {
+ if (UNEXPECTED(!generator->execute_data)) {
return;
}
- generator = zend_generator_get_current(orig_generator);
-
try_again:
if (generator->flags & ZEND_GENERATOR_CURRENTLY_RUNNING) {
zend_throw_error(NULL, "Cannot resume an already running generator");