]> granicus.if.org Git - php/commitdiff
make maximum manifest size 100MB for phar archives, simple apps are hitting the 1...
authorGreg Beaver <cellog@php.net>
Fri, 8 Feb 2008 05:56:26 +0000 (05:56 +0000)
committerGreg Beaver <cellog@php.net>
Fri, 8 Feb 2008 05:56:26 +0000 (05:56 +0000)
ext/phar/phar.c
ext/phar/tests/007.phpt

index 6c4e24507d7b930ded423cb2747d7b74ccbd82c6..c0d03575d31e3a46f51f7fdaa617dcdd454b27f1 100644 (file)
@@ -545,9 +545,9 @@ int phar_open_file(php_stream *fp, char *fname, int fname_len, char *alias, int
                MAPPHAR_ALLOC_FAIL("internal corruption of phar \"%s\" (truncated manifest at manifest length)")
        }
        PHAR_GET_32(buffer, manifest_len);
-       if (manifest_len > 1048576) {
-               /* prevent serious memory issues by limiting manifest to at most 1 MB in length */
-               MAPPHAR_ALLOC_FAIL("manifest cannot be larger than 1 MB in phar \"%s\"")
+       if (manifest_len > 1048576 * 100) {
+               /* prevent serious memory issues by limiting manifest to at most 100 MB in length */
+               MAPPHAR_ALLOC_FAIL("manifest cannot be larger than 100 MB in phar \"%s\"")
        }
        buffer = (char *)emalloc(manifest_len);
        savebuf = buffer;
index a8a2fb0d80bf2bc74241cf2dd5585447e2073469..a13c2a452afb3d97fb8a1e124cebdbc4367be617 100644 (file)
@@ -11,4 +11,4 @@ echo $e->getMessage();
 }
 __HALT_COMPILER(); ?>~~~~
 --EXPECTF--
-manifest cannot be larger than 1 MB in phar "%s"
+manifest cannot be larger than 100 MB in phar "%s"