Bug #79424 [NEW]: php_zip_glob uses gl_pathc after call to globfree

From: Date: Sat, 28 Mar 2020 07:58:47 +0000
Subject: Bug #79424 [NEW]: php_zip_glob uses gl_pathc after call to globfree
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226290@lists.php.net to get a copy of this message
From: maxcrees at me dot com Operating system: Linux/musl PHP version: 7.3Git-2020-03-28 (Git) Package: Zip Related Bug Type: Bug Bug description:php_zip_glob uses gl_pathc after call to globfree Description: ------------ On Linux with the musl libc, globfree zeroes out the gl_pathc field of the given glob_t struct[1]. This breaks the behavior of php_zip_glob (as used by ZipArchive::addGlob) since it calls globfree immediately before using the gl_pathc field of the struct as its return value. This is addressed by PR #5311. It affects all currently maintained branches of PHP (I believe 7.3, 7.4, and master, since 7.2 is "orange"). It was discovered indirectly by the existing tests ext/zip/tests/bug70103.phpt and ext/zip/tests/bug78641.phpt which resulted in ENOENT upon ZipArchive::close since no entries were added to the archive (gl_pathc == 0). [1] http://git.musl-libc.org/cgit/musl/tree/src/regex/glob.c#n306 -- Edit bug report at https://bugs.php.net/bug.php?id=79424&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79424&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79424&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79424&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79424&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79424&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79424&r=support Expected behavior: https://bugs.php.net/fix.php?id=79424&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79424&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79424&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79424&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79424&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79424&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79424&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79424&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79424&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79424&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79424&r=mysqlcfg

« previous php.bugs (#226290) next »