summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex
diff options
context:
space:
mode:
authordcs <dcs@FreeBSD.org>2000-07-06 06:34:15 +0000
committerdcs <dcs@FreeBSD.org>2000-07-06 06:34:15 +0000
commit2d066a2d8390bd0c92dbf1a6ca165d782d3d95a3 (patch)
treebebe6ceb7b3a03da2dc20ff784f6eb07972ebe11 /lib/libc/regex
parent966a32cd5be7d251249d23eed9b6f23015e0907c (diff)
downloadFreeBSD-src-2d066a2d8390bd0c92dbf1a6ca165d782d3d95a3.zip
FreeBSD-src-2d066a2d8390bd0c92dbf1a6ca165d782d3d95a3.tar.gz
Correct comment to work with test code.
Prevent out of bounds array access in some specific cases.
Diffstat (limited to 'lib/libc/regex')
-rw-r--r--lib/libc/regex/regcomp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c
index 9d18878..30d1b01 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++;
OpenPOWER on IntegriCloud