From owner-freebsd-bugs Mon Dec 10 20:20: 7 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 3E69037B416 for ; Mon, 10 Dec 2001 20:20:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id fBB4K1w07750; Mon, 10 Dec 2001 20:20:01 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id CE10637B41B for ; Mon, 10 Dec 2001 20:19:00 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id fBB4J0M07643; Mon, 10 Dec 2001 20:19:00 -0800 (PST) (envelope-from nobody) Message-Id: <200112110419.fBB4J0M07643@freefall.freebsd.org> Date: Mon, 10 Dec 2001 20:19:00 -0800 (PST) From: Koga Youichirou To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/32686: locate command dumps a core file with broken database Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 32686 >Category: bin >Synopsis: locate command dumps a core file with broken database >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Dec 10 20:20:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Koga Youichirou >Release: FreeBSD 4.4-STABLE >Organization: The FreeBSD Project (Japan) >Environment: FreeBSD xxx 4.4-STABLE FreeBSD 4.4-STABLE #2: Tue Dec 4 13:42:07 JST 2001 root@xxx:/path/to/src/sys/ XXX i386 >Description: locate command assumes that a database file is perfect, but it dumps a core file with a broken database. I don't think it should not dump a core file even if it uses a broken database. >How-To-Repeat: % cat /var/db/locate.db ~/somefile >locate.db % locate -d ./locate.db word (some search results) Segmentation fault (core dumped) >Fix: I think a check routine is needed in locate/fastfind.c near...: 290 if (*s == cc 291 #ifdef FF_ICASE 292 || TOLOWER(*s) == cc 293 #endif /* FF_ICASE */ 294 ) { /* fast first char check */ 295 for (p = patend - 1, q = s - 1; *p != '\0'; 296 p--, q--) 297 if (*q != *p 298 #ifdef FF_ICASE 299 && TOLOWER(*q) != *p >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message