mirror of
https://github.com/php/php-src.git
synced 2026-03-29 19:52:20 +02:00
plug multiple leaks
(you need to destroy the zval before changing its type manually)
This commit is contained in:
@@ -28,6 +28,7 @@ void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
|
||||
if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_CHECK_NO_ACCESS, &name)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument is expected to be a valid callback");
|
||||
efree(name);
|
||||
zval_dtor(value);
|
||||
Z_TYPE_P(value) = IS_NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -180,6 +180,7 @@ void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL)
|
||||
Z_STRLEN_P(value) = new_len;
|
||||
|
||||
if (new_len == 0) {
|
||||
zval_dtor(value);
|
||||
Z_TYPE_P(value) = IS_NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user