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";'
This commit is contained in:
Dmitry Stogov 2015-02-10 15:51:16 +00:00 committed by Andrea Faulds
parent b5513cdb69
commit d6bea5bb1e

View File

@ -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: