From 4f0d304ec835f478a4dd9b4ab7af01f5b826c6d7 Mon Sep 17 00:00:00 2001 From: Hugo van der Sanden Date: Tue, 21 Apr 2020 11:50:18 +0100 Subject: [PATCH] regexec: disallow zero-width nodes in regrepeat GH #17594: the logic here expects the node to have width 1 (except for LNBREAK), it is not expected to do the right thing on zero-width nodes. --- regexec.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/regexec.c b/regexec.c index 47e2833..5d3c465 100644 --- a/regexec.c +++ b/regexec.c @@ -9999,25 +9999,6 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p, } break; - case BOUNDL: - case NBOUNDL: - _CHECK_AND_WARN_PROBLEMATIC_LOCALE; - /* FALLTHROUGH */ - case BOUND: - case BOUNDA: - case BOUNDU: - case EOS: - case GPOS: - case KEEPS: - case NBOUND: - case NBOUNDA: - case NBOUNDU: - case OPFAIL: - case SBOL: - case SEOL: - /* These are all 0 width, so match right here or not at all. */ - break; - default: Perl_croak(aTHX_ "panic: regrepeat() called with unrecognized node type %d='%s'", OP(p), PL_reg_name[OP(p)]); NOT_REACHED; /* NOTREACHED */ -- 1.8.3.1