diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/zip/php_zip.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index aca478a780..79a81375de 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -508,9 +508,9 @@ static char * php_zipobj_get_zip_comment(struct zip *za, int *len) /* {{{ */ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_value) /* {{{ */ { #ifdef HAVE_GLOB - char cwd[MAXPATHLEN]; int cwd_skip = 0; #ifdef ZTS + char cwd[MAXPATHLEN]; char work_pattern[MAXPATHLEN]; char *result; #endif @@ -573,8 +573,7 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v /* we assume that any glob pattern will match files from one directory only so checking the dirname of the first match should be sufficient */ - strncpy(cwd, globbuf.gl_pathv[0], MAXPATHLEN); - if (ZIP_OPENBASEDIR_CHECKPATH(cwd)) { + if (ZIP_OPENBASEDIR_CHECKPATH(globbuf.gl_pathv[0])) { return -1; } |