Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Dec 2001 20:19:00 -0800 (PST)
From:      Koga Youichirou <y-koga@jp.FreeBSD.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/32686: locate command dumps a core file with broken database
Message-ID:  <200112110419.fBB4J0M07643@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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




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