1
0
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:
Nikita Popov
2020-01-03 12:03:31 +01:00
+2 -3
View File
@@ -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;
}