Re: PHP 4.0 Bug #5014 Updated: Can read files that dont exist causing memory leak
| From: | thies at digicol dot de | Date: | Thu, 15 Jun 2000 10:16:29 +0000 |
| Subject: | Re: PHP 4.0 Bug #5014 Updated: Can read files that dont exist causing memory leak | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-21404@lists.php.net to get a copy of this message | ||
On Thu, Jun 15, 2000 at 09:57:42AM -0000, Bug Database wrote:
> ID: 5014
> User Update by: adam@perfectgenius.com
> Status: Open
> Bug Type: Scripting Engine problem
> Description: Can read files that dont exist causing memory leak
>
> Sorry, I din't mean include();
you need to do extra error-checking here:
>
> $file = "/this/file/does/not/exist/.../hopefully";
> $fp = fopen("$file","r");
if ($fp) {
> while (!feof($fp)) {
> $buffer = fread($fp,512);
> }
}
also, i could not find a leak - your script simply does not
terminate..
problem is that
feof($something_but_an_open_file);
returns false (because $something_but_an_open_file i not a
valid parameter of feof());
tc
>
> Full Bug description available at:
> http://bugs.php.net/version4/?id=5014
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
> For additional commands, e-mail: php-dev-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany