From: Michael Wallner Date: Wed, 12 Oct 2005 17:40:45 +0000 (+0000) Subject: - don't try to allocate negative size X-Git-Tag: RELEASE_0_16_0~18 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=4c47eabee60a0266f3f27bf91528830b32da842e;p=m6w6%2Fext-http - don't try to allocate negative size - fix tests --- diff --git a/http_encoding_api.c b/http_encoding_api.c index a8d3ec0..4d08e71 100644 --- a/http_encoding_api.c +++ b/http_encoding_api.c @@ -261,6 +261,11 @@ inline STATUS http_verify_gzencode_buffer(const char *data, size_t data_len, con } } + if (data_len < offset + 8) { + http_error(error_level TSRMLS_CC, HTTP_E_ENCODING, "Missing or truncated GZIP footer"); + return FAILURE; + } + if (encoded) { *encoded = data + offset; } diff --git a/tests/HttpRequestPool_001.phpt b/tests/HttpRequestPool_001.phpt index a42650f..9f20fe4 100644 --- a/tests/HttpRequestPool_001.phpt +++ b/tests/HttpRequestPool_001.phpt @@ -6,8 +6,9 @@ include 'skip.inc'; checkver(5); checkcls('HttpRequestPool'); checkurl('www.php.net'); -checkurl('pear.php.net'); -checkurl('pecl.php.net'); +checkurl('de.php.net'); +checkurl('ch.php.net'); +checkurl('at.php.net'); checkurl('dev.iworks.at'); ?> --FILE-- @@ -15,8 +16,9 @@ checkurl('dev.iworks.at'); echo "-TEST\n"; $pool = new HttpRequestPool( new HttpRequest('http://www.php.net/', HTTP_METH_HEAD), - new HttpRequest('http://pear.php.net/', HTTP_METH_HEAD), - new HttpRequest('http://pecl.php.net/', HTTP_METH_HEAD), + new HttpRequest('http://at.php.net/', HTTP_METH_HEAD), + new HttpRequest('http://de.php.net/', HTTP_METH_HEAD), + new HttpRequest('http://ch.php.net/', HTTP_METH_HEAD), $post = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_POST) ); $post->addPostFields(array('a'=>1,'b'=>2)) ; @@ -41,11 +43,13 @@ echo "Done\n"; --EXPECTF-- %sTEST http://www.php.net/=200:200 -http://pear.php.net/=200:200 -http://pecl.php.net/=200:200 +http://at.php.net/=200:200 +http://de.php.net/=200:200 +http://ch.php.net/=200:200 http://dev.iworks.at/.print_request.php=200:200 . . . . +. Done diff --git a/tests/date_002.phpt b/tests/date_002.phpt index 522d0e2..1623595 100644 --- a/tests/date_002.phpt +++ b/tests/date_002.phpt @@ -4,11 +4,10 @@ http_date() without timestamp ---INI-- -date.timezone=GMT --FILE-- 1);