From 47ecee5e83a73a7b8f9e0fa78beab0ee6392c384 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Sat, 6 Jan 2001 18:17:06 +0000 Subject: [PATCH] Off by one error in reading mmap data. Submitted by: Martin Kraemer --- usr.bin/locate/locate/fastfind.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c index 68f8a86d2b2..8e29355857b 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 */ /*