summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2013-02-17 19:48:23 +0000
committermarkj <markj@FreeBSD.org>2013-02-17 19:48:23 +0000
commit5e903e7e4b7596bf09641ff4b72c79fb058f1bb4 (patch)
treef1a332eba30376103d0db9853b683b453c0b18eb /usr.bin
parenta8b029c7cfe6220819618eb3e2041a771c97b83b (diff)
downloadFreeBSD-src-5e903e7e4b7596bf09641ff4b72c79fb058f1bb4.zip
FreeBSD-src-5e903e7e4b7596bf09641ff4b72c79fb058f1bb4.tar.gz
Strengthen the check in IS_OUT_OF_BOUNDS to ensure that (j - 1) is a
valid index into the input buffer. PR: bin/175213 Reviewed by: gabor Approved by: emaste (co-mentor) MFC after: 1 week
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/grep/regex/tre-fastmatch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/grep/regex/tre-fastmatch.c b/usr.bin/grep/regex/tre-fastmatch.c
index b7a7c91..640ee3d 100644
--- a/usr.bin/grep/regex/tre-fastmatch.c
+++ b/usr.bin/grep/regex/tre-fastmatch.c
@@ -103,7 +103,7 @@ static int fastcmp(const fastmatch_t *fg, const void *data,
((!fg->reversed \
? ((type == STR_WIDE) ? ((j + fg->wlen) > len) \
: ((j + fg->len) > len)) \
- : (j < 0)))
+ : (j <= 0)))
/*
* Checks whether the new position after shifting in the input string
OpenPOWER on IntegriCloud