Skip Menu |

This queue is for tickets about the podlators CPAN distribution.

Report information
The Basics
Id: 29241
Status: resolved
Priority: 0/
Queue: podlators

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

Bug Information
Severity: Important
Broken in: 2.0.5
Fixed in: 2.0.6



Subject: [PATCH Pod::Man::devise_title] don't look past the end of an array
When devise_title is working its way through an array and the last element in that array is 'lib', it will look off the end of the array to see if the last plus one element matches /perl/. This causes a lot of undefined value warnings in the Module::Build tests in bleadperl. The attached is just a bit of a band-aid to make sure it doesn't walk off the end of the array; there may be some better way to restructure the code.
Subject: podman.patch.txt
--- lib/Pod/Man.pm;-0 Sat Sep 8 11:42:16 2007 +++ lib/Pod/Man.pm Sat Sep 8 19:01:47 2007 @@ -40,7 +40,7 @@ use POSIX qw(strftime); # Don't use the CVS revision as the version, since this module is also in Perl # core and too many things could munge CVS magic revision strings. This # number should ideally be the same as the CVS revision in podlators, however. -$VERSION = '2.12'; +$VERSION = '2.12_01'; # Set the debugging level. If someone has inserted a debug function into this # class already, use that. Otherwise, use any Pod::Simple debug function @@ -792,7 +792,7 @@ sub devise_title { my $cut = 0; my $i; for ($i = 0; $i < scalar @dirs; $i++) { - if ($dirs[$i] eq 'lib' && $dirs[$i + 1] =~ /perl/) { + if ($dirs[$i] eq 'lib' && $i+1 < scalar(@dirs) && $dirs[$i + 1] =~ /perl/) { $cut = $i + 2; last; } elsif ($dirs[$i] =~ /perl/) {
Subject: Re: [rt.cpan.org #29241] [PATCH Pod::Man::devise_title] don't look past the end of an array
Date: Tue, 11 Sep 2007 17:23:52 -0700
To: bug-podlators [...] rt.cpan.org
From: Russ Allbery <rra [...] stanford.edu>
"Craig A. Berry via RT" <bug-podlators@rt.cpan.org> writes: Show quoted text
> When devise_title is working its way through an array and the last > element in that array is 'lib', it will look off the end of the array to > see if the last plus one element matches /perl/. This causes a lot of > undefined value warnings in the Module::Build tests in bleadperl.
Show quoted text
> The attached is just a bit of a band-aid to make sure it doesn't walk > off the end of the array; there may be some better way to restructure > the code.
Yeah, it turns out that the whole check for lib/*perl* is pointless because the later more general check accomplishes the same thing. Thank you for pointing out this bug! It will be fixed in the next release. -- Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
This was fixed in 2.0.6, but I forgot to close it in RT.