Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: WolfSage [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: ExtraField values in constructor aren't checked properly
The ExtraField values in the constructor aren't checked properly. For example, this doesn't throw an error but should because there is a 3-character id ('bad'): #!/usr/bin/perl use strict; use warnings; use IO::Compress::Gzip; my $gzip = IO::Compress::Gzip->new('file.txt', ExtraField => [ at => 'mouse', bad => 'dog', ], ); This is because IO/Compress/Zlib/Extra.pm is attempting to iterate over the data by doing this: for (my $ix = 0; $ix <= length(@$data) -1 ; $ix += 2) { When it really wants: for (my $ix = 0; $ix <= @$data - 1; $ix += 2) { (length(@$data) is returning 1 - the length of the string '4') -- Matthew Horsfall (alh)
Thanks Matthew. good catch! Changed applied. Paul