Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17394 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32433 invoked by uid 1010); 25 Jul 2005 20:40:32 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 32418 invoked from network); 25 Jul 2005 20:40:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jul 2005 20:40:32 -0000 X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from ([80.74.107.235:54423] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.0 beta r(6227M)) with SMTP id 30/41-33635-F3E45E24 for ; Mon, 25 Jul 2005 16:40:32 -0400 Received: (qmail 24955 invoked from network); 25 Jul 2005 20:40:28 -0000 Received: from localhost (HELO ANDI-NOTEBOOK.zend.com) (127.0.0.1) by localhost with SMTP; 25 Jul 2005 20:40:28 -0000 Message-ID: <5.1.0.14.2.20050725134019.02af2570@localhost> X-Sender: andi@localhost X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Mon, 25 Jul 2005 13:40:26 -0700 To: Greg Beaver ,internals@lists.php.net In-Reply-To: <46.D7.33635.72170E24@pb1.pair.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] new bug in 5.1.0b3 with length param in fread() with local files From: andi@zend.com (Andi Gutmans) References: <46.D7.33635.72170E24@pb1.pair.com> Has anyone had a chance to look at this problem? At 10:08 PM 7/21/2005 -0600, Greg Beaver wrote: >Hi, > >I have noticed that fread()'s behavior has changed between PHP 5.0.4 and >PHP 5.1.0b3. Basically, http://pear.chiaraquartet.net/go-pear.phar works >in PHP 5.0.4 and fails in 5.1.0b3 because of this change. The line in >question of the .phar from PHP_Archive is: > > fread($this->_file, $this->internalFileLength + $this->footerLength); > >Basically, a .phar is a .tar. For files inside the .phar larger than >16000 bytes, the fread above fails with the incorrect error message: > >PHP Warning: fread(): Length parameter must be greater than 0 in >c:\php5\pear\PHP\Archive.php on line 193 > >Note that the failure is OS-independent. > >However, the actual length parameter is 21,155, which is not less than >zero, unless you consider it to be a negative number in binary. After the >fread in PHP 5.0.4, ftell() reveals that the pointer has advanced to >22016, whereas in 5.1.0b3, it has only advanced to 16384. > >According to the notes in http://bugs.php.net/bug.php?id=30936 this should >work with a local file, so should I re-open 30936, or is this a new bug? > >Greg > >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php