- don't try to allocate negative size
authorMichael Wallner <mike@php.net>
Wed, 12 Oct 2005 17:40:45 +0000 (17:40 +0000)
committerMichael Wallner <mike@php.net>
Wed, 12 Oct 2005 17:40:45 +0000 (17:40 +0000)
- fix tests

http_encoding_api.c
tests/HttpRequestPool_001.phpt
tests/date_002.phpt

index a8d3ec0e048c6a6e96f97d5c3bdc3e1186734c03..4d08e71c2c2bf5e582e74b0ae31c0dd33512489c 100644 (file)
@@ -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;
        }
index a42650ffcf8a1cf069d5223b8e88aad14a36c2ea..9f20fe4ee849fa631f391205f7f1effc7133cc3c 100644 (file)
@@ -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
index 522d0e2beff0c0e3334185b574cb932276ba6b65..1623595f87d69c0cd42128ae0697840e7447d8fd 100644 (file)
@@ -4,11 +4,10 @@ http_date() without timestamp
 <?php
 include 'skip.inc';
 ?>
---INI--
-date.timezone=GMT
 --FILE--
 <?php
 echo "-TEST\n";
+ini_set('date.timezone', 'GMT');
 $d = http_date();
 $t = strtotime($d);
 var_dump($t > 1);