summaryrefslogtreecommitdiff
path: root/usr.bin/locate
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2009-04-02 21:23:04 +0000
committerXin LI <delphij@FreeBSD.org>2009-04-02 21:23:04 +0000
commitab85842c90ebb972bea90d12aac66d1bc7de4d2b (patch)
tree2a02b1cca0f2568fcbd833ebc7097ab09bbd116a /usr.bin/locate
parent0e875ecafe3e19b28d542178f9caa4981f29045f (diff)
Notes
Diffstat (limited to 'usr.bin/locate')
-rw-r--r--usr.bin/locate/locate/fastfind.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c
index e132dbd53e59b..d9ab2d0fe140d 100644
--- a/usr.bin/locate/locate/fastfind.c
+++ b/usr.bin/locate/locate/fastfind.c
@@ -216,6 +216,8 @@ fastfind
count += c - OFFSET;
}
+ if (count < 0 || count > MAXPATHLEN)
+ errx(1, "corrupted database: %s", database);
/* overlay old path */
p = path + count;
foundchar = p - 1;