nikic                                    Fri, 02 Mar 2012 08:21:54 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=323804

Log:
Merge: Fix bug #61184 Phar::webPhar() generates headers with trailing NUL bytes

Bug: https://bugs.php.net/61184 (Assigned) Phar::webPhar() generates headers 
with trailing NUL bytes
      
Changed paths:
    U   php/php-src/branches/PHP_5_4/NEWS
    U   php/php-src/branches/PHP_5_4/ext/phar/phar_object.c

Modified: php/php-src/branches/PHP_5_4/NEWS
===================================================================
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-02 08:04:51 UTC (rev 323803)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-02 08:21:54 UTC (rev 323804)
@@ -28,6 +28,9 @@
 - Installation
   . Fixed bug #61172 (Add Apache 2.4 support). (Chris Jones)

+- Phar
+  . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL 
bytes). (Nikita Popov)
+
 - Reflection:
   . Fixed bug #60968 (Late static binding doesn't work with
     ReflectionMethod::invokeArgs()). (Laruence)

Modified: php/php-src/branches/PHP_5_4/ext/phar/phar_object.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/phar/phar_object.c 2012-03-02 08:04:51 UTC 
(rev 323803)
+++ php/php-src/branches/PHP_5_4/ext/phar/phar_object.c 2012-03-02 08:21:54 UTC 
(rev 323804)
@@ -428,7 +428,7 @@
        sapi_header_line ctr = {0};

        ctr.response_code = 403;
-       ctr.line_len = sizeof("HTTP/1.0 403 Access Denied");
+       ctr.line_len = sizeof("HTTP/1.0 403 Access Denied")-1;
        ctr.line = "HTTP/1.0 403 Access Denied";
        sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
        sapi_send_headers(TSRMLS_C);
@@ -453,7 +453,7 @@
        }

        ctr.response_code = 404;
-       ctr.line_len = sizeof("HTTP/1.0 404 Not Found")+1;
+       ctr.line_len = sizeof("HTTP/1.0 404 Not Found")-1;
        ctr.line = "HTTP/1.0 404 Not Found";
        sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
        sapi_send_headers(TSRMLS_C);
@@ -893,7 +893,7 @@
                        char *tmp = NULL, sa = '\0';
                        sapi_header_line ctr = {0};
                        ctr.response_code = 301;
-                       ctr.line_len = sizeof("HTTP/1.1 301 Moved 
Permanently")+1;
+                       ctr.line_len = sizeof("HTTP/1.1 301 Moved 
Permanently")-1;
                        ctr.line = "HTTP/1.1 301 Moved Permanently";
                        sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to