com php-src: Fixed use after free on the following code: Zend/zend_execute.c

From: Date: Tue, 10 Feb 2015 15:51:16 +0000
Subject: com php-src: Fixed use after free on the following code: Zend/zend_execute.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-85708@lists.php.net to get a copy of this message
Commit: d6bea5bb1e5f4811e45162343cb7e513d9fcbec5 Author: Dmitry Stogov <dmitry@zend.com> Tue, 10 Feb 2015 15:51:16 +0000 Committer: Andrea Faulds <ajf@ajf.me> Tue, 10 Feb 2015 15:51:16 +0000 Parents: b5513cdb698bab1abbde3900c95f703f39b07228 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d6bea5bb1e5f4811e45162343cb7e513d9fcbec5 Log: Fixed use after free on the following code sapi/cli/php -r 'function hello(string $world) : string { var_dump(bin2hex($world)); return $world; } echo "foo" . hello(6) . "\n";' Changed paths: M Zend/zend_execute.c Diff: diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 0d4634f..584f2be 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -646,11 +646,10 @@ static zend_bool zend_verify_scalar_type_hint(zend_uchar type_hint, zval *arg, z case IS_STRING: { zend_string *dest; + /* on success "arg" is converted to IS_STRING */ if (!zend_parse_arg_str(arg, &dest, 0, strict)) { return 0; } - zval_ptr_dtor(arg); - ZVAL_STR(arg, dest); return 1; } default:

« previous php.cvs (#85708) next »