From 15410a4f666ee92b8a6ab9b15935e0d4a3c2ac0f Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Fri, 8 Feb 2008 05:56:26 +0000 Subject: [PATCH] make maximum manifest size 100MB for phar archives, simple apps are hitting the 1 MB limit quite easily. --- ext/phar/phar.c | 6 +++--- ext/phar/tests/007.phpt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 6c4e24507d..c0d03575d3 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -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; diff --git a/ext/phar/tests/007.phpt b/ext/phar/tests/007.phpt index a8a2fb0d80..a13c2a452a 100644 --- a/ext/phar/tests/007.phpt +++ b/ext/phar/tests/007.phpt @@ -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" -- 2.40.0