summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorwosch <wosch@FreeBSD.org>2001-01-06 18:17:06 +0000
committerwosch <wosch@FreeBSD.org>2001-01-06 18:17:06 +0000
commit41607c818a7f2e2661b4e1fcc4841a2d236f1bdd (patch)
tree1ce646737dfc6bac0e9505b06710f7aa2c561aa6 /usr.bin
parente564c617f8aadbc77f1edc9eddeb5206cc9fb74c (diff)
downloadFreeBSD-src-41607c818a7f2e2661b4e1fcc4841a2d236f1bdd.zip
FreeBSD-src-41607c818a7f2e2661b4e1fcc4841a2d236f1bdd.tar.gz
Off by one error in reading mmap data.
Submitted by: Martin Kraemer <Martin.Kraemer@Fujitsu-Siemens.com>
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/locate/locate/fastfind.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c
index 68f8a86..8e29355 100644
--- a/usr.bin/locate/locate/fastfind.c
+++ b/usr.bin/locate/locate/fastfind.c
@@ -219,11 +219,12 @@ fastfind
p = path + count;
foundchar = p - 1;
- for (;;) {
#ifdef FF_MMAP
+ for (; len > 0;) {
c = (u_char)*paddr++;
len--;
#else
+ for (;;) {
c = getc(fp);
#endif /* FF_MMAP */
/*
OpenPOWER on IntegriCloud