Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Apr 2009 14:10:42 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r190920 - in stable/7/usr.bin/locate: . locate
Message-ID:  <200904111410.n3BEAgrp088243@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904111410.n3BEAgrp088243>