summaryrefslogtreecommitdiff
path: root/regex.c
diff options
context:
space:
mode:
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/regex.c b/regex.c
index b3cbb77f2c..c5a903e721 100644
--- a/regex.c
+++ b/regex.c
@@ -2812,6 +2812,7 @@ re_search(bufp, string, size, startpos, range, regs)
}
}
+ if (startpos > size) return -1;
if (fastmap && startpos == size && range >= 0
&& (bufp->can_be_null == 0 ||
(bufp->can_be_null && size > 0