Hide Forgot
Description of problem: Perl module IO::Uncompress::Unzip version 2.020, which is part of perl-IO-Compress-Zlib package, which in turn is built out of perl SRPM, has an annoying bug in nextStream method, see http://compgroups.net/comp.lang.perl.misc/Bug-in-IO-Uncompress-Unzip-nextStream The bug is known to be fixed in IO::Uncompress::Unzip version 2.030. Version-Release number of selected component (if applicable): perl-5.10.1 perl-IO-Compress-Zlib-2.020 How reproducible: Always Steps to Reproduce: perl -MIO::Uncompress::Unzip -e '$q = IO::Uncompress::Unzip->new("foo.zip"); while ($q->nextStream) { }' Actual results: Endless loop since nextStream always returns 1. Expected results: nextStream should return 0 after the last stream was found, and thus the loop should end. Additional info:
Created attachment 572755 [details] Reproducer This automated test gives up waiting for nextStream() cycle in 5 second.
This is working fix from 2.030: --- IO-Compress-2.027/lib/IO/Uncompress/Base.pm 2010-04-24 11:42:55.000000000 +0200 +++ IO-Compress-2.030/lib/IO/Uncompress/Base.pm 2010-07-24 13:49:13.000000000 +0200 @@ -980,7 +980,7 @@ #*$self->{EndStream} = 0 ; if ( ! defined $magic) { - if (! *$self->{Transparent} ) + if (! *$self->{Transparent} || $self->eof()) { *$self->{EndStream} = 1 ; return 0; No rebase is needed. I will prepare patch against big perl source package.
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause Running IO::Uncompress::Unzip->nextStream() on last ZIP stream. Consequence IO::Uncompress::Unzip::nextStream does not return 0 as documented which can change application code path. For example infinite cycle. Fix Fix from upstream version 2.030 has been back-ported. Result IO::Uncompress::Unzip::nextStream behaves as documented now.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,5 +1,6 @@ Cause - Running IO::Uncompress::Unzip->nextStream() on last ZIP stream. + Calling nextStream() method on IO::Uncompress::Unzip object + with last stream in ZIP decoder. Consequence IO::Uncompress::Unzip::nextStream does not return 0 as documented which can change application code path. For example
Thanks for pulling this in! (In Czech: Diky, Petre!)
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2012-0843.html