mirror of
https://github.com/php/php-src.git
synced 2026-04-21 23:18:13 +02:00
Merge branch 'PHP-7.4'
* PHP-7.4: Remove unnecessary strncpy in zip
This commit is contained in:
+2
-3
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user