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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
9 + 24 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Wed Apr 24 18:01:28 2024 UTC