svn commit: r190920 - in stable/7/usr.bin/locate: . locate
Xin LI
delphij at FreeBSD.org
Sat Apr 11 07:10:43 PDT 2009
Author: delphij
Date: Sat Apr 11 14:10:42 2009
New Revision: 190920
URL: http://svn.freebsd.org/changeset/base/190920
Log:
MFC r190656:
Fix a crash when corrupted data file is found.
PR: bin/32686
Approved by: re (kib)
Modified:
stable/7/usr.bin/locate/ (props changed)
stable/7/usr.bin/locate/locate/fastfind.c
Modified: stable/7/usr.bin/locate/locate/fastfind.c
==============================================================================
--- stable/7/usr.bin/locate/locate/fastfind.c Sat Apr 11 14:01:01 2009 (r190919)
+++ stable/7/usr.bin/locate/locate/fastfind.c Sat Apr 11 14:10:42 2009 (r190920)
@@ -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;
More information about the svn-src-stable-7
mailing list