Skip to content

Commit 78ec64a

Browse files
committed
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. Closes GH-11202
1 parent baa07f3 commit 78ec64a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/phar/phar_object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3697,7 +3697,7 @@ PHP_METHOD(Phar, offsetSet)
36973697
{
36983698
char *fname, *cont_str = NULL;
36993699
size_t fname_len, cont_len;
3700-
zval *zresource;
3700+
zval *zresource = NULL;
37013701

37023702
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "pr", &fname, &fname_len, &zresource) == FAILURE
37033703
&& zend_parse_parameters(ZEND_NUM_ARGS(), "ps", &fname, &fname_len, &cont_str, &cont_len) == FAILURE) {

0 commit comments

Comments
 (0)