Fix RT #121321 - Fencepost error causes infinite loop in regex compilation
authorYves Orton <demerphq@gmail.com>
Tue, 25 Feb 2014 11:07:18 +0000 (12:07 +0100)
committerYves Orton <demerphq@gmail.com>
Tue, 25 Feb 2014 11:10:22 +0000 (12:10 +0100)
commit845ab12d77c07580053486e445977dc895d747f8
tree1edfcdec11566971fa28dfab50c6edf808f1e14d
parent313e09e70abdc9a57e7f4b1a814b5bddc652fcf4
Fix RT #121321 - Fencepost error causes infinite loop in regex compilation

Due to a fencepost error if a pattern had more than 9 capture buffers
and after the last capture buffer there was an octal style escape which
when interpreted as decimal evaluated to one more than the number of
defined buffers then the regex compiler would go into an infinite loop.

This fixes the fencepost error, adds tests, and adds some comments to
explain what is going on.
regcomp.c
t/re/re_tests