Date: Sat, 11 Apr 2009 14:13:39 +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-6@freebsd.org Subject: svn commit: r190922 - in stable/6/usr.bin/locate: . locate Message-ID: <200904111413.n3BEDdfq088403@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904111413.n3BEDdfq088403>