Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 806373

Summary: IO::Uncompress::Unzip->nextStream() does not return 0 at last ZIP stream
Product: Red Hat Enterprise Linux 6 Reporter: Jan Holcapek <holcapek>
Component: perlAssignee: perl-maint-list
Status: CLOSED ERRATA QA Contact: Lukáš Zachar <lzachar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2CC: holcapek, ppisar, psabata, psplicha
Target Milestone: rcKeywords: EasyFix
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: perl-5.10.1-126.el6 Doc Type: Bug Fix
Doc Text:
Cause 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 infinite cycle. Fix Fix from upstream version 2.030 has been back-ported. Result IO::Uncompress::Unzip::nextStream behaves as documented now.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 13:47:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Reproducer none

Description Jan Holcapek 2012-03-23 15:09:16 UTC
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:

Comment 2 Petr Pisar 2012-03-26 13:45:35 UTC
Created attachment 572755 [details]
Reproducer

This automated test gives up waiting for nextStream() cycle in 5 second.

Comment 3 Petr Pisar 2012-03-26 15:21:13 UTC
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.

Comment 5 RHEL Program Management 2012-03-27 07:40:01 UTC
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.

Comment 7 Petr Pisar 2012-03-27 12:02:56 UTC
    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.

Comment 9 Petr Pisar 2012-03-27 12:36:29 UTC
    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

Comment 12 Jan Holcapek 2012-04-06 09:50:35 UTC
Thanks for pulling this in!

(In Czech: Diky, Petre!)

Comment 14 errata-xmlrpc 2012-06-20 13:47:45 UTC
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