summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-20 18:54:27 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-20 18:54:27 +0000
commit8fdd422b549aa89c85abf0d3cec589db64be43b6 (patch)
tree2d83d546348c524501577c9a936f6e5faeff615c /regexec.c
parent2c19a612638327a9654b39302223a9a15fba4160 (diff)
downloadperl-8fdd422b549aa89c85abf0d3cec589db64be43b6.tar.gz
avoid reading out-of-bounds memory when matching against reference
p4raw-id: //depot/perl@5167
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/regexec.c b/regexec.c
index f9f2cc0535..d2ebc4483b 100644
--- a/regexec.c
+++ b/regexec.c
@@ -688,7 +688,7 @@ Perl_re_intuit_start(pTHX_ regexp *prog, SV *sv, char *strpos,
? s + (prog->minlen? cl_l : 0)
: (prog->float_substr ? check_at - start_shift + cl_l
: strend) ;
- char *startpos = sv ? strend - SvCUR(sv) : s;
+ char *startpos = sv && SvPOK(sv) ? strend - SvCUR(sv) : s;
t = s;
if (prog->reganch & ROPT_UTF8) {