In perl.git, the branch blead has been updated <https://perl5.git.perl.org/perl.git/commitdiff/232b691f3c51aaff6228f1358b7c7dbc09b41b14?hp=9eccdb0c883aba75b8e69f4550a95d8f90a54cf8>
- Log ----------------------------------------------------------------- commit 232b691f3c51aaff6228f1358b7c7dbc09b41b14 Author: Karl Williamson <k...@cpan.org> Date: Wed Oct 31 10:22:03 2018 -0600 PATCH: [perl #133620] heap buffer overflow This happens when an alternate parse string is constructed, and the error message needs to be translated into the terms of the original one, the error is just past the right edge. The translation was not getting done. Simply use the original terms. ----------------------------------------------------------------------- Summary of changes: regcomp.c | 2 +- t/re/re_tests | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/regcomp.c b/regcomp.c index 105059f532..5d5f715969 100644 --- a/regcomp.c +++ b/regcomp.c @@ -686,7 +686,7 @@ static const scan_data_t zero_scan_data = { #define REPORT_LOCATION_ARGS(xC) \ UTF8fARG(UTF, \ (xI(xC) > eI) /* Don't run off end */ \ - ? eC - sC /* Length before the <--HERE */ \ + ? eI - sI /* Length before the <--HERE */ \ : ((xI_offset(xC) >= 0) \ ? xI_offset(xC) \ : (Perl_croak(aTHX_ "panic: %s: %d: negative offset: %" \ diff --git a/t/re/re_tests b/t/re/re_tests index f4747f6315..2959f86dca 100644 --- a/t/re/re_tests +++ b/t/re/re_tests @@ -1999,6 +1999,7 @@ AB\s+\x{100} AB \x{100}X y - - (?il)\x{100}|\x{100}|\x{FE} \xFE y $& \xFE \A([\x00-\x7F]+)(.*)\z \007\011\012 y $& \007\011\012 # [perl #133311] (?:(?^:(?{1}))[^0-9]) : y $& : # [perl #133348] +/[\xdf-/i - c - Invalid [] range # [perl #133620] likely only fails under valgrind # Keep these lines at the end of the file # vim: softtabstop=0 noexpandtab -- Perl5 Master Repository