Skip to content

Commit

Permalink
Fix #79424 ext/zip: don't use gl_pathc after call to globfree
Browse files Browse the repository at this point in the history
This breaks on Linux with the musl libc, since it zeroes out gl_pathc during
globfree.
  • Loading branch information
maxcrees authored and remicollet committed Mar 29, 2020
1 parent 7f9b534 commit 0492064
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -34,6 +34,8 @@ PHP NEWS

- Zip:
. Fixed Bug #79296 (ZipArchive::open fails on empty file). (Remi)
. Fixed bug #79424 (php_zip_glob uses gl_pathc after call to globfree).
(Max Rees)

19 Mar 2020, PHP 7.3.16

Expand Down
3 changes: 2 additions & 1 deletion ext/zip/php_zip.c
Expand Up @@ -606,8 +606,9 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v
add_next_index_string(return_value, globbuf.gl_pathv[n]+cwd_skip);
}

ret = globbuf.gl_pathc;
globfree(&globbuf);
return globbuf.gl_pathc;
return ret;
#else
zend_throw_error(NULL, "Glob support is not available");
return 0;
Expand Down

0 comments on commit 0492064

Please sign in to comment.