In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/33e493d3ba71689dfaec10efd9847548790cc922?hp=66c742d5709538d20fcc9da3f377be437119ba19>
- Log ----------------------------------------------------------------- commit 33e493d3ba71689dfaec10efd9847548790cc922 Author: Karl Williamson <[email protected]> Date: Fri Aug 1 11:19:06 2014 -0600 regcomp.c: Don't read outside array bound This code is only in DEBUGGING builds had an off-by-one error that would read beyond the end of the array. This commit also removes a redundant test ----------------------------------------------------------------------- Summary of changes: regcomp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/regcomp.c b/regcomp.c index 8075010..6530068 100644 --- a/regcomp.c +++ b/regcomp.c @@ -16678,12 +16678,12 @@ S_put_latin1_charclass_innards(pTHX_ SV *sv, char *bitmap) PERL_ARGS_ASSERT_PUT_LATIN1_CHARCLASS_INNARDS; for (i = 0; i < 256; i++) { - if (i < 256 && BITMAP_TEST((U8 *) bitmap,i)) { + if (BITMAP_TEST((U8 *) bitmap,i)) { /* The character at index i should be output. Find the next * character that should NOT be output */ int j; - for (j = i + 1; j <= 256; j++) { + for (j = i + 1; j < 256; j++) { if (! BITMAP_TEST((U8 *) bitmap, j)) { break; } -- Perl5 Master Repository
