php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14056 Large amounts of fileuploads in a page cause segmentation fault
Submitted: 2001-11-14 12:08 UTC Modified: 2001-11-15 07:35 UTC
From: michiel at tincan dot co dot uk Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.0.6 OS: Redhat 7.0
Private report: No CVE-ID: None
 [2001-11-14 12:08 UTC] michiel at tincan dot co dot uk
<!-- example that causes the error -->
<!-- you don't need to upload any files, just clicking Submit will cause the crash -->
<form method=post enctype="multipart/form-data">
<?

if (is_array($file))
  while (list($key,$val) = each($file))
    print "$key => $val<br>\n";

# changing max to 33 will not cause the segfault, 34 will.
$msx = 34;

for ($i=0;$i<$msx;$i++) {
  print $i.'Upload file: <input type=file name="file['.$i.']"><br>';
}

?>
<input type=submit>
</form>

<--end of example -->

--with-mysql=/usr --enable-sysvshm=yes --enable-sysvsem=yes --enable-versioning --with-gd=/usr --enable-track-vars=yes --enable-force-cgi-redirect=yes --enable-memory-limit=yes --with-apache=../apache_1.3.19 --enable-debug=no --with-mcrypt

Page works if I switch back to php 4.0.4-pl1



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-14 12:30 UTC] derick@php.net
Can you try a snapshot from snaps.php.net and report back if that fixes the problem?

Derick
 [2001-11-14 13:13 UTC] mfischer@php.net
Cannot reproduce with current CVS.
 [2001-11-15 05:53 UTC] michiel at tincan dot co dot uk
Yes, it is fixed in the current CVS, I used, php4-200111150000

I could even increase max to 300 and it worked. However, when submitting my test script with no files inserted for upload, the values of the file uploads were not "none", but a temporary file. Unexpected behaviour which may lead to problems. The size of the (temp)files is 0, but the value of the variable should be "none" or "".
 [2001-11-15 05:55 UTC] bate@php.net
Its now Fixed.
 [2001-11-15 07:35 UTC] sniper@php.net
The next release, 4.1.0 should work just fine.
( you can try the RC2 from http://www.php.net/~zeev/php-4.1.0RC2.tar.gz)

Latest CVS has new code for handling file uploads and
it's under development.
 
I'm fixing this 'no file sent' to behave same as it does
in 4.1.0.

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 06:01:34 2024 UTC