php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64888 Integer Overflow when processing MAX_FILE_SIZE
Submitted: 2013-05-21 13:10 UTC Modified: 2016-08-21 04:22 UTC
Votes:6
Avg. Score:3.3 ± 1.2
Reproduced:5 of 5 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: php at paalsteek dot de Assigned: cmb (profile)
Status: No Feedback Package: FPM related
PHP Version: 5.4.15 OS: Arch Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at paalsteek dot de
New email:
PHP Version: OS:

 

 [2013-05-21 13:10 UTC] php at paalsteek dot de
Description:
------------
When uploading files I get an error UPLOAD_ERR_FORM_SIZE when setting MAX_FILE_SIZE in the input form to values greater or equal to 2147483648 (2^31).
This problem does not exist on a CentOS 6.4 using Apache 2.2.15. Therefore I guess this is an implementation specific problem of php-fpm.

Test script:
---------------
HTML form:
<html>
<body>
<form action="https://owncloud.paalsteek.de/test.php" method="post" enctype="multipart/form-data">
<input id="max_upload" type="hidden" value="2147483648" name="MAX_FILE_SIZE" original-title="">
<input id="requesttoken" type="hidden" value="013ac1f5ecd5e025b1ee" name="requesttoken" original-title="">
<input class="max_human_file_size" type="hidden" value="(max 2.3 GB)" original-title="">
<input id="dir" type="hidden" value="/" name="dir" original-title="">
<input type="file" name="test" />
<input type="submit" />
</form>
</body>
</html>

PHP code:
<?php

var_dump($_FILES["test"]["error"]);
?>


Expected result:
----------------
int(0)

Actual result:
--------------
int(2)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-08 17:05 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2016-08-08 17:05 UTC] cmb@php.net
> Therefore I guess this is an implementation specific problem of
> php-fpm.

I'm not sure. It might as well be related to respective variables
being defined as int[1] (whose size is platform specific). This
has changed, however, as of PHP 5.6.0 to int64_t[2].

Has this change solved the issue for you?

[1] <https://github.com/php/php-src/blob/PHP-5.5/main/rfc1867.c#L683>
[2] <https://github.com/php/php-src/blob/PHP-5.6.0/main/rfc1867.c#L685>
 [2016-08-21 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 21:01:29 2024 UTC