From a4d5991f53b1f694e00788c47d6658e93cefc6a5 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Sun, 7 May 2023 12:01:13 +0200 Subject: [PATCH] Fix use-of-uninitialized value in phar_object.c resource would stay uninitialized if the first call to zend_parse_parameters fails, but the value is still passed to phar_add_file(). It's not used there if cont_str is provided and so didn't cause any issues. --- ext/phar/phar_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index e32b530b82297..f329c3b0b17b2 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -3697,7 +3697,7 @@ PHP_METHOD(Phar, offsetSet) { char *fname, *cont_str = NULL; size_t fname_len, cont_len; - zval *zresource; + zval *zresource = NULL; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "pr", &fname, &fname_len, &zresource) == FAILURE && zend_parse_parameters(ZEND_NUM_ARGS(), "ps", &fname, &fname_len, &cont_str, &cont_len) == FAILURE) {