From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 21:23:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 184441065670; Thu, 2 Apr 2009 21:23:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06FBB8FC15; Thu, 2 Apr 2009 21:23:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32LN40U076381; Thu, 2 Apr 2009 21:23:04 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32LN4hp076380; Thu, 2 Apr 2009 21:23:04 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200904022123.n32LN4hp076380@svn.freebsd.org> From: Xin LI Date: Thu, 2 Apr 2009 21:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190656 - head/usr.bin/locate/locate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 21:23:05 -0000 Author: delphij Date: Thu Apr 2 21:23:04 2009 New Revision: 190656 URL: http://svn.freebsd.org/changeset/base/190656 Log: Don't crash when we have an invalid count number. PR: bin/32686 Submitted by: Jaakko Heinonen MFC after: 1 week Modified: head/usr.bin/locate/locate/fastfind.c Modified: head/usr.bin/locate/locate/fastfind.c ============================================================================== --- head/usr.bin/locate/locate/fastfind.c Thu Apr 2 21:16:20 2009 (r190655) +++ head/usr.bin/locate/locate/fastfind.c Thu Apr 2 21:23:04 2009 (r190656) @@ -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;