mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
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:
parent
b5513cdb69
commit
d6bea5bb1e
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user