Mercurial > gnulib
changeset 40168:f533980eb42f
autoupdate
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Thu, 31 Jan 2019 13:24:44 -0800 |
parents | c1aa6d1185ea |
children | ecb43221748b |
files | lib/regexec.c |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/regexec.c Wed Jan 30 03:53:43 2019 +0100 +++ b/lib/regexec.c Thu Jan 31 13:24:44 2019 -0800 @@ -1293,8 +1293,10 @@ 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; } }