PHP 4.0 Bug #10229 Updated: buffer error in fread
| From: | apeeters at lashout dot net | Date: | Sun, 08 Apr 2001 00:17:04 +0000 |
| Subject: | PHP 4.0 Bug #10229 Updated: buffer error in fread | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-51126@lists.php.net to get a copy of this message | ||
ID: 10229
User Update by: apeeters@lashout.net
Old-Status: Feedback
Status: Open
Bug Type: Filesystem function related
Description: buffer error in fread
I've been testing a bit more and have a clear reproducible codesnippet, it yields the same
results in php 4.0.4p1, so I changed the PHP version for this bugreport.
---start---
$fp = fopen("http://www.newsplanet.be/",
"r");
$content = fread($fp, 100000);
fclose($fp);
$fp = fopen("http://www.google.com/",
"r");
$content = fread($fp, 100000);
mail("me@host", "topic", $content);
---stop---
In this mail, I see the sourcecode from google.com followed by the rest of the code from
newsplanet.be. This does occur in about 1/3 of the mails I try, although I'm unable to see why
this isn't always the case.
Previous Comments:
---------------------------------------------------------------------------
[2001-04-07 19:46:47] cnewbill@php.net
Can't reproduce with CVS version. Try upgrading to the newest release 4.04pl1 or grab a CVS
snapshot from http://snaps.php.net/
What URL is it that is doing this? Or is it every URL?
-Chris
---------------------------------------------------------------------------
[2001-04-07 19:25:09] apeeters@lashout.net
While running the following code, I got weird results in my mailbox. It seemed like I got the
entire buffer of 100000 bytes mailed, instead of only the length of the result of the url. And
those mails contained php code from another site hosted at the same server. This worries me, and I
think this needs a serious checkup.
The bug is reproducible :)
---start---
$fp = fopen("http://someurl/", "r");
$content = fread($fp, 100000);
mail("someone@somehost", "test", $content);
---stop---
Additional info:
'./configure' '--prefix=/usr' '--with-apxs=/usr/sbin/apxs'
'--with-gd' '--with-gettext=/usr' '--enable-safe-mode'
'--with-config-file-path=/etc/httpd' '--with-exec-dir=/usr/bin'
'--with-zlib' '--enable-magic-quotes' '--with-regex=system'
'--with-ttf=/usr/lib/libttf.so' '--enable-track-vars' '--enable-xml'
'--disable-debug' '--with-db3' '--with-interbase=shared'
'--with-pgsql=shared' '--with-ldap' '--with-imap'
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=10229