bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #38673] locate segfaults


From: Bram
Subject: [bug #38673] locate segfaults
Date: Tue, 16 Apr 2013 12:04:00 +0000
User-agent: Opera/9.64 (X11; Linux i686; U; en) Presto/2.1.1

Follow-up Comment #1, bug #38673 (project findutils):

Using gdb on the core dump shows:

(gdb) bt
#0  splitstring (s=0x0, separators=0x8055922 ":", first=false, pos=0xbfcfe174,
len=0xbfcfe178) at splitstring.c:58
#1  0x0804ae21 in dolocate (argc=2, argv=0xbfcfee44, secure_db_fd=-1) at
locate.c:1892
#2  0x08049955 in main (argc=2, argv=0xbfcfee44) at locate.c:1940


locate.c:1892 contains:
     if (!splitstring (locate_path, path_separators, false,
                        &path_element_pos, &path_element_len))


Goign 'up' in the gdb session and printing locate_path shows:

(gdb) up
#1  0x0804ae21 in dolocate (argc=2, argv=0xbfd4c154, secure_db_fd=-1) at
locate.c:1892
1892    locate.c: No such file or directory.
        in locate.c
(gdb) print locate_path
$1 = 0x0
(gdb) print path_separators
$2 = 0x8055922 ":"


It appears that splitstring is unable to handle the null argument..

A work around for the segfault appears to be with setting the database:
* 'locate foo' --> segfault
* 'locate -d /var/db/locatedb foo' --> no segfault
* 'LOCATE_PATH=/var/db/locatedb locate foo' --> no segfault

Not sure what the proper fix is tho..
Checking for null in splitstring.c and/or locate.c seems easy enough but is
that the proper fix?


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?38673>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]