]> granicus.if.org Git - php/commitdiff
- #51273, Content-length header is limited to 32bit integer with apache2/windows
authorPierre Joye <pajoye@php.net>
Mon, 3 May 2010 17:47:58 +0000 (17:47 +0000)
committerPierre Joye <pajoye@php.net>
Mon, 3 May 2010 17:47:58 +0000 (17:47 +0000)
NEWS
sapi/apache2handler/sapi_apache2.c

diff --git a/NEWS b/NEWS
index f7f00de5a42162f4a0bd4bee7aaa7b1bcee49f4d..7186b06c3a54d46ad90aaf65568471b32ec6e251 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -37,6 +37,8 @@ PHP                                                                        NEWS
   requests (Fixes CVE-2010-0397, bug #51288). (Raphael Geissert)
 - Fixed 64-bit integer overflow in mhash_keygen_s2k(). (ClĂ©ment LECIGNE, Stas)
 
+- Fixed bug #51723 (Content-length header is limited to 32bit integer with
+  Apache2 on Windows). (Pierre)
 - Fixed bug #51690 (Phar::setStub looks for case-sensitive
   __HALT_COMPILER()). (Ilia)
 - Fixed bug #51688 (ini per dir crashes when invalid document root  are given).
index 3d1c5ae7650f412ddb2f9c0d9d77dcbc2761b86e..765132d05b759283dc893870fc08808ba4c1d0cc 100644 (file)
@@ -120,7 +120,15 @@ php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_e
                                }
                                ctx->content_type = estrdup(val);
                        } else if (!strcasecmp(sapi_header->header, "content-length")) {
-                               ap_set_content_length(ctx->r, strtol(val, (char **)NULL, 10));
+#ifdef PHP_WINDOWS
+# 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));
+# endif
+#else
+                               ap_set_content_length(ctx->r, (apr_off_t) strtol(val, (char **)NULL, 10));
+#endif
                        } else if (op == SAPI_HEADER_REPLACE) {
                                apr_table_set(ctx->r->headers_out, sapi_header->header, val);
                        } else {