Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17385 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5416 invoked by uid 1010); 22 Jul 2005 15:57:44 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 5401 invoked from network); 22 Jul 2005 15:57:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2005 15:57:44 -0000 X-Host-Fingerprint: 69.64.38.41 bluga.net Linux 2.5 (sometimes 2.4) (4) Received: from ([69.64.38.41:54737] helo=bluga.net) by pb1.pair.com (ecelerity 2.0 beta r(6227M)) with SMTP id F2/37-33635-77711E24 for ; Fri, 22 Jul 2005 11:57:44 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by bluga.net (Postfix) with ESMTP id 3B1D721C1A9; Fri, 22 Jul 2005 10:57:14 -0500 (CDT) Received: from bluga.net ([127.0.0.1]) by localhost (bluga.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15377-14; Fri, 22 Jul 2005 10:57:14 -0500 (CDT) Received: from [4.228.84.63] (dialup-4.228.84.63.Dial1.Denver1.Level3.net [4.228.84.63]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by bluga.net (Postfix) with ESMTP id AD1B021C0E4; Fri, 22 Jul 2005 10:57:12 -0500 (CDT) Message-ID: <42E11771.1070002@php.net> Date: Fri, 22 Jul 2005 09:57:37 -0600 User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Wez Furlong CC: internals@lists.php.net References: <46.D7.33635.72170E24@pb1.pair.com> <4e89b4260507220536439a0eb0@mail.gmail.com> In-Reply-To: <4e89b4260507220536439a0eb0@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new using ClamAV at bluga.net Subject: Re: [PHP-DEV] new bug in 5.1.0b3 with length param in fread() with local files From: cellog@php.net (Greg Beaver) Wez Furlong wrote: > If you've spotted a behaviour change, open a new bug with a short > self-contained reproducing script. I suspect some kind of engine bug > here, because what you've described doesn't make sense :) > > That warning about the length comes from this code in the fread function: > > len = Z_LVAL_PP(arg2); > if (len <= 0) { > php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter > must be greater than 0"); > RETURN_FALSE; > } > > So either you are passing in something that evaluates as 0 (or less), > or something is corrupting memory and breaking the length value by the > time it reaches fread(). In the attempt to find a short reproducing test script, I determined that the warning was caused by an earlier iteration through the method that uses fread. So, the warning was valid (0 was being passed in). What this means, however, is that the script is in fact simply failing to read in the requested amount with no warning at all. I'll have a test script shortly for the bug report. Greg