summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex/regcomp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/regex/regcomp.c')
-rw-r--r--lib/libc/regex/regcomp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c
index bf92f2c..602ddb0 100644
--- a/lib/libc/regex/regcomp.c
+++ b/lib/libc/regex/regcomp.c
@@ -2045,7 +2045,8 @@ struct re_guts *g;
g->mlen + ssuffix - suffix);
suffix++;
}
- ssuffix = pmatches[ssuffix];
+ if (suffix < g->mlen)
+ ssuffix = pmatches[ssuffix];
}
free(pmatches);
OpenPOWER on IntegriCloud