diff options
author | Karl Williamson <khw@cpan.org> | 2019-04-09 20:22:34 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2019-04-09 20:26:25 -0600 |
commit | b92b2705fea1ae06e2e671bfdd4d52927df528a5 (patch) | |
tree | 71d78824a3987860b1f924a4798f115b296f1e37 /regexec.c | |
parent | 0a5ed81e6617c9229cc1ea042e9a70c3ec63fd65 (diff) | |
download | perl-b92b2705fea1ae06e2e671bfdd4d52927df528a5.tar.gz |
PATCH: [perl #133999] Assertion failure in regex match
This was caused by failing to limit matching to within the bounds of the
target string. I'm pretty sure this bug has long been there, but was
exposed by the recently added wildcard property matching feature.
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1972,9 +1972,12 @@ STMT_START { } /* This is the macro to use when we want to see if something that looks like it - * could match, actually does, and if so exits the loop */ -#define REXEC_FBC_TRYIT \ - if ((reginfo->intuit || regtry(reginfo, &s))) \ + * could match, actually does, and if so exits the loop. It needs to be used + * only for bounds checking macros, as it allows for matching beyond the end of + * string (which should be zero length without having to look at the string + * contents) */ +#define REXEC_FBC_TRYIT \ + if ((reginfo->intuit || (s <= reginfo->strend && regtry(reginfo, &s)))) \ goto got_it /* The only difference between the BOUND and NBOUND cases is that |