summaryrefslogtreecommitdiff
path: root/sapi/cli/php_cli.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-01-22 11:50:42 +0300
committerDmitry Stogov <dmitry@zend.com>2015-01-22 11:50:42 +0300
commit3e31838d19750d287431d22e9290856ec962fd6a (patch)
tree47f531e9bc442106f5eee978104fa14f1a5d19d2 /sapi/cli/php_cli.c
parent201f660ae11488eeacd16ee7adbe79fc8a28e27d (diff)
downloadphp-git-3e31838d19750d287431d22e9290856ec962fd6a.tar.gz
zend_read_property() has to provide a holder for return value.
Previously it was possible that zend_read_property() returned pointer to zval allocated on stack.
Diffstat (limited to 'sapi/cli/php_cli.c')
-rw-r--r--sapi/cli/php_cli.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 07d7825dc7..ca0ea57fa7 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -1107,10 +1107,10 @@ static int do_cli(int argc, char **argv) /* {{{ */
zend_call_method_with_1_params(&ref, pce, &pce->constructor, "__construct", NULL, &arg);
if (EG(exception)) {
- zval tmp, *msg;
+ zval tmp, *msg, rv;
ZVAL_OBJ(&tmp, EG(exception));
- msg = zend_read_property(zend_exception_get_default(), &tmp, "message", sizeof("message")-1, 0);
+ msg = zend_read_property(zend_exception_get_default(), &tmp, "message", sizeof("message")-1, 0, &rv);
zend_printf("Exception: %s\n", Z_STRVAL_P(msg));
zval_ptr_dtor(&tmp);
EG(exception) = NULL;