]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4'
authorChristoph M. Becker <cmbecker69@gmx.de>
Tue, 30 Jun 2020 08:48:58 +0000 (10:48 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Tue, 30 Jun 2020 08:48:58 +0000 (10:48 +0200)
* PHP-7.4:
  Fix #70362: Can't copy() large 'data://' with open_basedir

1  2 
ext/standard/file.c

index cdd6d767dbc6927f72ffd383dda7a2d7340d8613,a68db967f1995b520f63a9980b45859b96036908..763409d1813ff1bb070ba2ae8c0f5bcff38ec641
@@@ -1603,10 -1659,10 +1603,10 @@@ PHP_FUNCTION(copy
                Z_PARAM_PATH(source, source_len)
                Z_PARAM_PATH(target, target_len)
                Z_PARAM_OPTIONAL
 -              Z_PARAM_RESOURCE_EX(zcontext, 1, 0)
 +              Z_PARAM_RESOURCE_OR_NULL(zcontext)
        ZEND_PARSE_PARAMETERS_END();
  
-       if (php_check_open_basedir(source)) {
+       if (php_stream_locate_url_wrapper(source, NULL, 0) == &php_plain_files_wrapper && php_check_open_basedir(source)) {
                RETURN_FALSE;
        }