mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
Fix bug #67858: Leak when $php_errormsg already set
This commit is contained in:
parent
eda5d30be9
commit
26a9dc3e04
19
Zend/tests/bug67858.phpt
Normal file
19
Zend/tests/bug67858.phpt
Normal file
@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
Bug #67858: Leak when $php_errormsg already set
|
||||
--INI--
|
||||
track_errors=1
|
||||
error_reporting=E_ALL
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function f() {
|
||||
$php_errormsg = [1, 2, 3];
|
||||
echo $var;
|
||||
var_dump($php_errormsg);
|
||||
}
|
||||
f();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: var in %s on line %d
|
||||
string(23) "Undefined variable: var"
|
@ -1724,6 +1724,7 @@ ZEND_API int zend_set_local_var_str(const char *name, int len, zval *value, int
|
||||
if (op_array->vars[i]->h == h &&
|
||||
op_array->vars[i]->len == len &&
|
||||
memcmp(op_array->vars[i]->val, name, len) == 0) {
|
||||
zval_ptr_dtor(EX_VAR_NUM(i));
|
||||
ZVAL_COPY_VALUE(EX_VAR_NUM(i), value);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user