svn commit: r190922 - in stable/6/usr.bin/locate: . locate

Xin LI delphij at FreeBSD.org
Sat Apr 11 07:13:40 PDT 2009


Author: delphij
Date: Sat Apr 11 14:13:39 2009
New Revision: 190922
URL: http://svn.freebsd.org/changeset/base/190922

Log:
  MFC r190656:
  
  Fix a crash when corrupted data file is found.
  
  PR:             bin/32686

Modified:
  stable/6/usr.bin/locate/   (props changed)
  stable/6/usr.bin/locate/locate/fastfind.c

Modified: stable/6/usr.bin/locate/locate/fastfind.c
==============================================================================
--- stable/6/usr.bin/locate/locate/fastfind.c	Sat Apr 11 14:12:44 2009	(r190921)
+++ stable/6/usr.bin/locate/locate/fastfind.c	Sat Apr 11 14:13:39 2009	(r190922)
@@ -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 mailing list