|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60205 possible integer overflow in content_length
Submitted: 2011-11-03 07:04 UTC Modified: 2011-11-03 07:26 UTC
From: Assigned: laruence
Status: Closed Package: *General Issues
PHP Version: 5.3.8 OS:
Private report: No CVE-ID:
 [2011-11-03 07:04 UTC]
in php_apache_request_ctor (sapi/apache2handler/sapi_apache2.c)

	SG(request_info).content_length = (content_length ? atoi(content_length) : 

so when the content_length exceed INT_MAX,  the content_length will be a wrong 

Test script:

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-03 07:12 UTC]
actullay this cause the upload progress(also apc, session upload progress) return 
wrong message when try to uploading   bigger than 4GB file in 64-bit OS.

change atoi to atol can make this more sense(long content_length in the 
request_info struct defination)
 [2011-11-03 07:12 UTC]
-Assigned To: +Assigned To: laruence
 [2011-11-03 07:24 UTC]
-Summary: possible interge overflow in content_length +Summary: possible integer overflow in content_length
 [2011-11-03 07:26 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

 [2011-11-03 07:26 UTC]
-Status: Assigned +Status: Closed -Package: Apache2 related +Package: *General Issues
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Sun Nov 29 05:01:53 2015 UTC