php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18363 [chm] bug on function.fread.html
Submitted: 2002-07-16 01:15 UTC Modified: 2002-10-17 01:00 UTC
Votes:6
Avg. Score:5.0 ± 0.0
Reproduced:5 of 5 (100.0%)
Same Version:3 (60.0%)
Same OS:4 (80.0%)
From: asyka at kimo dot com dot tw Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 4.2.1 OS: windows
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-07-16 01:15 UTC] asyka at kimo dot com dot tw
I have found a bug on page function.fread.html
[chm date: 2002-04-20]...
in php 4.2.1 fread function
sometime may crash php (show can't read 0x000... memory address)
what's wrong?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-16 01:55 UTC] derick@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.

 [2002-07-17 02:11 UTC] asyka at kimo dot com dot tw
i try fread function(binary file) to read execution file may crash php(apache)
because exectuion file header is 0x00(????), that is the file header is memory protection area
so win2000 kernal may send signal fail
----------------------------------------------------
fread can detection execution file in previous processed?
that is do noting for execution file format...
 [2002-07-17 02:18 UTC] sniper@php.net
oops...misunderstood (!) this. 
Can you please show us a SHORT example script which
causes this crash?

 [2002-07-17 02:52 UTC] asyka at kimo dot com dot tw
for example:(abc.exe is execution file)
$fp=fopen("abc.exe","rb");
$exe_get=fread($fp,filesize("abc.exe"));
 [2002-07-23 00:59 UTC] alfil_uno at hotmail dot com
When reading with the function fread I have found an error when read hexadecimal "1A", not, but I believe that they must more of the sort have.
 [2002-10-01 18:09 UTC] iliaa@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip

I've tried opening various exe and com files and I am unable to replicate the crash you've reported. Please try the latest  release and see if the problem still occurs.
 [2002-10-17 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over 2 weeks, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2003-01-03 10:22 UTC] josh at trollprod dot com
I got a similar problem with file which containt 1A (hexa) but no crash the fread only skip the 1A ... on Win NT with Apache/1.3.27 (Win32) PHP/4.2.3 

I have the same probleme with : Apache/1.3.27 (Win32) PHP/4.4.0-dev 
for example a 7437824 bytes files become a 7.437.722 Bytes files 

here is the code I use :
$file1 = @fopen($localfile, "rb");
$file2 = @fopen($destfile, "w");
while (!feof($fp)) {
fwrite($file2,fread($file1, filesize($localfile)));
}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 08:01:30 2024 UTC