pajoye                                   Mon, 03 May 2010 17:47:58 +0000

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

Log:
- #51273, Content-length header is limited to 32bit integer with apache2/windows

Bug: http://bugs.php.net/51273 (Open) Faultstring property does not exist when 
the faultstring is empty
      
Changed paths:
    U   php/php-src/branches/PHP_5_2/NEWS
    U   php/php-src/branches/PHP_5_2/sapi/apache2handler/sapi_apache2.c
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c
    U   php/php-src/trunk/sapi/apache2handler/sapi_apache2.c

Modified: php/php-src/branches/PHP_5_2/NEWS
===================================================================
--- php/php-src/branches/PHP_5_2/NEWS   2010-05-03 17:10:04 UTC (rev 298918)
+++ php/php-src/branches/PHP_5_2/NEWS   2010-05-03 17:47:58 UTC (rev 298919)
@@ -18,6 +18,8 @@
 - Fixed a possible arbitrary memory access inside sqlite extension. Reported
   by Mateusz Kocielski. (Ilia)

+- Fixed bug #51723 (Content-length header is limited to 32bit integer with
+  Apache2 on Windows). (Pierre)
 - Fixed bug #51671 (imagefill does not work correctly for small images).
   (Pierre)
 - Fixed bug #51670 (getColumnMeta causes segfault when re-executing query

Modified: php/php-src/branches/PHP_5_2/sapi/apache2handler/sapi_apache2.c
===================================================================
--- php/php-src/branches/PHP_5_2/sapi/apache2handler/sapi_apache2.c     
2010-05-03 17:10:04 UTC (rev 298918)
+++ php/php-src/branches/PHP_5_2/sapi/apache2handler/sapi_apache2.c     
2010-05-03 17:47:58 UTC (rev 298919)
@@ -110,7 +110,15 @@
                }
                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 (sapi_header->replace) {
                apr_table_set(ctx->r->headers_out, sapi_header->header, val);
        } else {

Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS   2010-05-03 17:10:04 UTC (rev 298918)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-05-03 17:47:58 UTC (rev 298919)
@@ -37,6 +37,8 @@
   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).

Modified: php/php-src/branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c
===================================================================
--- php/php-src/branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c     
2010-05-03 17:10:04 UTC (rev 298918)
+++ php/php-src/branches/PHP_5_3/sapi/apache2handler/sapi_apache2.c     
2010-05-03 17:47:58 UTC (rev 298919)
@@ -120,7 +120,15 @@
                                }
                                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 {

Modified: php/php-src/trunk/sapi/apache2handler/sapi_apache2.c
===================================================================
--- php/php-src/trunk/sapi/apache2handler/sapi_apache2.c        2010-05-03 
17:10:04 UTC (rev 298918)
+++ php/php-src/trunk/sapi/apache2handler/sapi_apache2.c        2010-05-03 
17:47:58 UTC (rev 298919)
@@ -120,7 +120,15 @@
                                }
                                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 {

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

Reply via email to