]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
autoupdate
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 31 Jan 2019 21:24:44 +0000 (13:24 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 31 Jan 2019 21:25:08 +0000 (13:25 -0800)
lib/regexec.c

index 91d5a797b82e2679ceab74238416de06693e46ea..084b1222d95b62eb2930166060174ef78cb74b02 100644 (file)
@@ -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;
                }
            }