fix phar copy-on-write
authorAnatol Belski <ab@php.net>
Thu, 28 Aug 2014 15:35:54 +0000 (17:35 +0200)
committerAnatol Belski <ab@php.net>
Thu, 28 Aug 2014 15:35:54 +0000 (17:35 +0200)
ext/phar/phar_object.c

index 2d34cf6bfb0456afa401a6f48029ab413311b1b1..ed3e60a0eac3bf228f68269a310f03fdb401e4f4 100755 (executable)
@@ -3421,6 +3421,7 @@ PHP_METHOD(Phar, copy)
                }
        }
 
+       tmp_len = (int)newfile_len;
        if (phar_path_check(&newfile, &tmp_len, &pcr_error) > pcr_is_ok) {
                zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
                                "file \"%s\" contains invalid characters %s, cannot be copied from \"%s\" in phar %s", newfile, pcr_error, oldfile, phar_obj->archive->fname);