summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2015-02-10 02:09:13 +0000
committerHugo van der Sanden <hv@crypt.org>2015-02-10 02:17:07 +0000
commit7082c44063b6e00b0bad96f3d8adec0946f1938c (patch)
tree434c1c111ac1603b8cc929fd45e78cce4fc725fc /regcomp.c
parent47c2f9f1b715c476e20d480ef9540b2af28ec283 (diff)
downloadperl-7082c44063b6e00b0bad96f3d8adec0946f1938c.tar.gz
regcomp can read past end of string after parsing flags
New test in 8a6d8ec6fe revealed additional code problem reading past end of string under clang with sanitize=address.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index e069a15d32..9e1fab9e89 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -10414,7 +10414,8 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
parse_flags:
parse_lparen_question_flags(pRExC_state);
if (UCHARAT(RExC_parse) != ':') {
- nextchar(pRExC_state);
+ if (*RExC_parse)
+ nextchar(pRExC_state);
*flagp = TRYAGAIN;
return NULL;
}