This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regmatch(): fix out bounds array access
authorDavid Mitchell <davem@iabyn.com>
Fri, 19 Oct 2012 09:14:56 +0000 (10:14 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 19 Oct 2012 09:50:22 +0000 (10:50 +0100)
commit1443c94c5785506d57ff756925baa65702a6cf98
tree6f8f9a4b884c359689d27193af1bc5e12b864152
parente6ca698ca4309632ab09826ad47492d2934e10bd
regmatch(): fix out bounds array access

The code for EXACTF and similar tests that

    UCHARAT(s) != fold_array[nextchr]

but doesn't check first that nextchr != NEXTCHR_EOS (-10), so it can
access the byte 10 bytes before the start of one of the PL_fold_latin1 or
similar arrays. Although undesirable, it's harmless, as the worst it can
achieve is a false positive match of the first char of the EXACTF string,
which will then still fail on a full compare of the string.
regexec.c