Bug#536495: perl: missing / incorrect overflow check when indexing arrays

Sebastian Harl tokkee at debian.org
Fri Jul 10 12:52:00 UTC 2009


Package: perl
Version: 5.8.8-7etch6
Severity: normal

Hi,

Perl does not handle large array indexes correctly:

 % perl -e '$a[23] = "foo\n"; print $a[1 + ~1];'
 foo

FTR: That '1 + ~1' produces expected results when not used as an array
index:

 % perl -e 'print 1 + ~1, $/;'
 4294967295

While I do not expect Perl to handle arbitrary large array indexes, it
would be very nice to get a warning in that case instead of a random
(well, it actually seems to be always the last) element of the array.

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/perl-maintainers/attachments/20090710/2c3c2212/attachment.pgp>


More information about the Perl-maintainers mailing list