From 6a7357fe50fd8e84ce174832affb7dbba460337e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 31 Jan 2019 13:24:44 -0800 Subject: [PATCH] autoupdate --- lib/regexec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/regexec.c b/lib/regexec.c index 91d5a797b8..084b1222d9 100644 --- a/lib/regexec.c +++ b/lib/regexec.c @@ -1293,8 +1293,10 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs, else if (naccepted) { char *buf = (char *) re_string_get_buffer (&mctx->input); - if (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx, - naccepted) != 0) + if (mctx->input.valid_len - *pidx < naccepted + || (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx, + naccepted) + != 0)) return -1; } } -- 2.39.5