]> granicus.if.org Git - php/commitdiff
Merge: Fix bug #61184 Phar::webPhar() generates headers with trailing NUL bytes
authorNikita Popov <nikic@php.net>
Fri, 2 Mar 2012 08:21:54 +0000 (08:21 +0000)
committerNikita Popov <nikic@php.net>
Fri, 2 Mar 2012 08:21:54 +0000 (08:21 +0000)
NEWS
ext/phar/phar_object.c

diff --git a/NEWS b/NEWS
index 66f7f06c7dc066c38bee4bc969193757dfa45cf1..ac804e0b2200050bbdb756f32290fbabcd0a2135 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,9 @@ PHP                                                                        NEWS
 - 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)
index 782acfa7f8ea24bdf58144891ad7d650fa6b2e9c..de9fffc115b620d3e3e9e282a713b90abe7db909 100644 (file)
@@ -428,7 +428,7 @@ static void phar_do_403(char *entry, int entry_len TSRMLS_DC) /* {{{ */
        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 @@ static void phar_do_404(phar_archive_data *phar, char *fname, int fname_len, cha
        }
 
        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 @@ PHP_METHOD(Phar, webPhar)
                        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);