This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix for Coverity perl5 CID 29034: Out-of-bounds read (OVERRUN) overrun-local: Overrun...
authorJarkko Hietaniemi <jhi@iki.fi>
Tue, 22 Apr 2014 01:43:12 +0000 (21:43 -0400)
committerTony Cook <tony@develop-help.com>
Tue, 29 Apr 2014 23:58:53 +0000 (09:58 +1000)
commitadc2d0c9de764f1cb892860df8ecc93dc8909b39
treeecfc5cba6fc7d278683dd9d8d8cd2b6970a44471
parent2a600bb8f7c0d6b36cb37c899b6c9e82537ec394
Fix for Coverity perl5 CID 29034: Out-of-bounds read (OVERRUN) overrun-local: Overrunning array PL_reg_intflags name of 14 8-byte elements at element index 31 (byte offset 248) using index bit (which evaluates to 31).

Needed compile-time limits for the PL_reg_intflags_name so that the
bit loop doesn't waltz off past the array.  Could not use C_ARRAY_LENGTH
because the size of name array is not visible during compile time
(only const char*[] is), so modified regcomp.pl to generate the size,
made it visible only under DEBUGGING.  Did extflags analogously
even though its size currently exactly 32 already.  The sizeof(flags)*8
is extra paranoia for ILP64.
regcomp.c
regen/regcomp.pl
regnodes.h