Skip Menu |

This queue is for tickets about the Compress-Zlib CPAN distribution.

Report information
The Basics
Id: 13613
Status: resolved
Priority: 0/
Queue: Compress-Zlib

People
Owner: pmqs [...] cpan.org
Requestors: kmurugan [...] novell.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 2.000_01



Subject: ZLib::Compress 1.34 - print uncompress($f) - gives segfault.
This is the negative test case. Please see the attached file to reproduce the error This is happening at this last line in the file print uncompress($f), where $f is a file handle.
use IO::File ; use Compress::Zlib ; my $filename = "rw.zip" ; sub ok { my ($no, $ok) = @_ ; print "ok $no\n" if $ok ; print "not ok $no\n" unless $ok ; } BEGIN{ unlink "rw.gz"; } my $len=length (my $hello = "hello world\nthis is a test\n"); #create a test file my $f = new IO::File ">$filename" ; binmode $f ; # for OS/2 print $f $hello; ok(3, my $fil = gzopen($f, "wb")) ; ok(4, $fil->gzwrite($hello) == $len) ; ok(5, ! $fil->gzclose ) ; $f1 = new IO::File ">>$filename" ; binmode $f1 ; # for OS/2 $i=0; $tempString="String to write\n"; print $f1 compress($tempString),print STDOUT uncompress(compress($tempString)), $i++ while($i++<=1000); ok(6, ! $fil->gzclose ) ; print uncompress($f);
[guest - Sat Jul 9 03:31:27 2005]: Show quoted text
> This is the negative test case. > > Please see the attached file to reproduce the error > This is happening at this last line in the file print uncompress($f), > where $f is a file handle.
Thanks for the bug report. You are attempting to pass a filehandle to the compress function. Unfortunately that function isn't designed to accept filehandles. Admittedly, though, generating a core isn't very polite. I'll see if I can add a test to compress to get it to check that its parameter list doesn't contain anything it can't handle. cheers Paul