diff options
author | Max Rees <maxcrees@me.com> | 2020-03-27 12:57:24 -0500 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2020-03-29 14:22:31 +0200 |
commit | 04920645f14ea117d5248ef3a0e03c6784c2fb49 (patch) | |
tree | 67367bd564bf5643c99dbc9c1dbcc7cfe56cdbca /ext/zip | |
parent | 7f9b534e3a3c8129b7ddcb86454483c43a309387 (diff) | |
download | php-git-04920645f14ea117d5248ef3a0e03c6784c2fb49.tar.gz |
Fix #79424 ext/zip: don't use gl_pathc after call to globfree
This breaks on Linux with the musl libc, since it zeroes out gl_pathc during
globfree.
Diffstat (limited to 'ext/zip')
-rw-r--r-- | ext/zip/php_zip.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 48af712b9c..9cbef05285 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -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; |