php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #52679
Patch big-content-length.patch revision 2010-08-23 19:48 UTC by dominic dot benson at thirdlight dot com

Patch big-content-length.patch for Apache2 related Bug #52679

Patch version 2010-08-23 19:48 UTC

Return to Bug #52679 | Download this patch
Patch Revisions:

Developer: dominic.benson@thirdlight.com

diff -rupN php-5.3.3/sapi/apache/mod_php5.c php-5.3.3-patched/sapi/apache/mod_php5.c
--- php-5.3.3/sapi/apache/mod_php5.c	2010-03-12 10:28:59.000000000 +0000
+++ php-5.3.3-patched/sapi/apache/mod_php5.c	2010-08-23 20:19:10.337448769 +0100
@@ -197,7 +197,7 @@ static int sapi_apache_header_handler(sa
 			if (!strcasecmp(header_name, "Content-Type")) {
 				r->content_type = pstrdup(r->pool, header_content);
                        } else if (!strcasecmp(header_name, "Content-Length")) {
-                               ap_set_content_length(r, strtol(header_content, (char **)NULL, 10));
+                               ap_set_content_length(r, strtoll(header_content, (char **)NULL, 10));
 			} else if (!strcasecmp(header_name, "Set-Cookie")) {
 				table_add(r->headers_out, header_name, header_content);
 			} else if (op == SAPI_HEADER_REPLACE) {
diff -rupN php-5.3.3/sapi/apache2filter/sapi_apache2.c php-5.3.3-patched/sapi/apache2filter/sapi_apache2.c
--- php-5.3.3/sapi/apache2filter/sapi_apache2.c	2010-02-05 18:59:05.000000000 +0000
+++ php-5.3.3-patched/sapi/apache2filter/sapi_apache2.c	2010-08-23 20:19:10.341454490 +0100
@@ -128,7 +128,7 @@ php_apache_sapi_header_handler(sapi_head
 			if (!strcasecmp(sapi_header->header, "content-type"))
 				ctx->r->content_type = apr_pstrdup(ctx->r->pool, val);
                        else if (!strcasecmp(sapi_header->header, "content-length"))
-                               ap_set_content_length(ctx->r, strtol(val, (char **)NULL, 10));
+                               ap_set_content_length(ctx->r, strtoll(val, (char **)NULL, 10));
 			else if (op == SAPI_HEADER_REPLACE)
 				apr_table_set(ctx->r->headers_out, sapi_header->header, val);
 			else
diff -rupN php-5.3.3/sapi/apache2handler/sapi_apache2.c php-5.3.3-patched/sapi/apache2handler/sapi_apache2.c
--- php-5.3.3/sapi/apache2handler/sapi_apache2.c	2010-05-04 10:51:03.000000000 +0100
+++ php-5.3.3-patched/sapi/apache2handler/sapi_apache2.c	2010-08-23 20:19:10.361449061 +0100
@@ -130,10 +130,10 @@ php_apache_sapi_header_handler(sapi_head
 # ifdef APR_HAS_LARGE_FILES
 				ap_set_content_length(ctx->r, (apr_off_t) _strtoui64(val, (char **)NULL, 10));
 # else
-				ap_set_content_length(ctx->r, (apr_off_t) strtol(val, (char **)NULL, 10));
+				ap_set_content_length(ctx->r, (apr_off_t) strtoll(val, (char **)NULL, 10));
 # endif
 #else
-				ap_set_content_length(ctx->r, (apr_off_t) strtol(val, (char **)NULL, 10));
+				ap_set_content_length(ctx->r, (apr_off_t) strtoll(val, (char **)NULL, 10));
 #endif
 			} else if (op == SAPI_HEADER_REPLACE) {
 				apr_table_set(ctx->r->headers_out, sapi_header->header, val);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 30 05:01:29 2024 UTC