This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
don't call Perl_fbm_instr() with negative length
authorDavid Mitchell <davem@iabyn.com>
Fri, 16 Jun 2017 14:46:19 +0000 (15:46 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 16 Jun 2017 14:46:19 +0000 (15:46 +0100)
commitbb152a4b442f7718fd37d32cc558be675e8ae1ae
treee11cac104d1b6f97cb88028da323c0c891a5cb61
parent9a4e033ca5abe2a94a5b47e25968106278ede709
don't call Perl_fbm_instr() with negative length

RT #131575

re_intuit_start() could calculate a maximum end position less than the
current start position. This used to get rejected by fbm_intr(), until
v5.23.3-110-g147f21b, which made fbm_intr() faster and removed unnecessary
checks.

This commits fixes re_intuit_start(), and adds an assert to  fbm_intr().
regexec.c
t/re/pat.t
util.c