From 9868274b74837957cbd36be821c1ce8ffe7437bf Mon Sep 17 00:00:00 2001 From: "Daniel C. Sobral" Date: Thu, 6 Jul 2000 06:34:15 +0000 Subject: [PATCH] Correct comment to work with test code. Prevent out of bounds array access in some specific cases. --- lib/libc/regex/regcomp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c index 9d1887895e30..30d1b01f9cff 100644 --- a/lib/libc/regex/regcomp.c +++ b/lib/libc/regex/regcomp.c @@ -1849,7 +1849,7 @@ register struct re_guts *g; /* - altoffset - choose biggest offset among multiple choices - = static int altoffset(sop *scan, int offset, int mccs); + == static int altoffset(sop *scan, int offset, int mccs); * * Compute, recursively if necessary, the largest offset among multiple * re paths. @@ -2034,7 +2034,7 @@ struct re_guts *g; ssuffix = pmatches[suffix]; while (suffix < g->mlen) { - while (suffix <= ssuffix) { + while (suffix <= ssuffix && suffix < g->mlen) { g->matchjump[suffix] = MIN(g->matchjump[suffix], g->mlen + ssuffix - suffix); suffix++;