Req #52679 [NEW]: Content-length header is limited to 32bit integer
From:
Operating system: Linux 32
PHP version: 5.3.3
Package: Apache2 related
Bug Type: Feature/Change Request
Bug description:Content-length header is limited to 32bit integer
Description:
------------
As per #51723, the content-length header is limited to 2GB - however it
need not be.
If Apache 2.2 is built with -DLARGEFILE_SOURCE -DFILE_OFFSET_BITS=64 then
apr_off_t is an off64_t, however the conversion in the calls to
ap_set_content_length uses strtocol (hence limited to the 32-bit long on
Linux 32), but if strtocoll is used instead to return a 64-bit long long,
the header is set correctly for values > 2GB.
The attached patch is of the adjustment, I guess the configure script
generation needs to be updated to establish whether apr_off_t is long or
long long.
Test script:
---------------
<?php
header("Content-Length: 10000000000");
?>
Expected result:
----------------
A header:
Content-Length: 10000000000
Actual result:
--------------
A header:
Content-Length: 2147483647
--
Edit bug report at http://bugs.php.net/bug.php?id=52679&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52679&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52679&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52679&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=52679&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52679&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=52679&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=52679&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=52679&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=52679&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=52679&r=support
Expected behavior: http://bugs.php.net/fix.php?id=52679&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=52679&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=52679&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=52679&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52679&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52679&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=52679&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=52679&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=52679&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=52679&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=52679&r=mysqlcfg
Thread (6 messages)
- dominic dot benson at thirdlight dot com