Skip to content

Commit 556757d

Browse files
iliaaldevnexen
authored andcommitted
Fix build: use php_globfree wrapper in ZipArchive::addGlob early returns
phpGH-21702 added two `globfree()` calls at the no-match and open_basedir reject paths, but called `globfree` directly instead of the `php_globfree` wrapper used at the success path below. PHP-8.5 dropped the direct `<glob.h>` include from `ext/zip/php_zip.c` in favor of the `php_glob.h` wrapper, so the build now breaks with `-Werror=implicit-function-declaration` on systems where `<glob.h>` isn't transitively included. Match the existing wrapper usage at line 675. close phpGH-21709
1 parent 493b59a commit 556757d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ext/zip/php_zip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,14 +636,14 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v
636636

637637
/* now catch the FreeBSD style of "no matches" */
638638
if (!globbuf.gl_pathc || !globbuf.gl_pathv) {
639-
globfree(&globbuf);
639+
php_globfree(&globbuf);
640640
return 0;
641641
}
642642

643643
/* we assume that any glob pattern will match files from one directory only
644644
so checking the dirname of the first match should be sufficient */
645645
if (ZIP_OPENBASEDIR_CHECKPATH(globbuf.gl_pathv[0])) {
646-
globfree(&globbuf);
646+
php_globfree(&globbuf);
647647
return -1;
648648
}
649649

0 commit comments

Comments
 (0)