diff options
| author | christos <christos@NetBSD.org> | 2006-02-12 00:45:01 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2006-02-12 00:45:01 +0000 |
| commit | 557f9b049f6b9ffaf9d488c64f805df286fa2dbf (patch) | |
| tree | ec65551e6f4da4a11d064675bc498bea387f09c3 /usr.bin/locate | |
| parent | d881eb70dda9fa101607423ce2e8875725b3e8be (diff) | |
PR/32799: David H. Gutteridge: Apparent off-by-one error in locate(1) causes
incorrect behaviour when entries with the maximum path length are encountered
Diffstat (limited to 'usr.bin/locate')
| -rw-r--r-- | usr.bin/locate/locate/locate.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/locate/locate/locate.c b/usr.bin/locate/locate/locate.c index e8c68a46e46..5711ffb7131 100644 --- a/usr.bin/locate/locate/locate.c +++ b/usr.bin/locate/locate/locate.c @@ -1,4 +1,4 @@ -/* $NetBSD: locate.c,v 1.13 2003/08/07 11:14:21 agc Exp $ */ +/* $NetBSD: locate.c,v 1.14 2006/02/12 00:45:01 christos Exp $ */ /* * Copyright (c) 1989, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\ #if 0 static char sccsid[] = "@(#)locate.c 8.1 (Berkeley) 6/6/93"; #endif -__RCSID("$NetBSD: locate.c,v 1.13 2003/08/07 11:14:21 agc Exp $"); +__RCSID("$NetBSD: locate.c,v 1.14 2006/02/12 00:45:01 christos Exp $"); #endif /* not lint */ /* @@ -206,7 +206,7 @@ fastfind(FILE *fp, char *pathpart) /* overlay old path */ for (p = path + count; (c = getc(fp)) > SWITCH;) { /* sanity check */ - if (p < path || p >= path + sizeof(path) - 2) + if (p < path || p >= path + sizeof(path) - 1) return -1; /* invalid database file */ if (c < PARITY) *p++ = c; |
