bugfindutils - Bugs: bug #38239, missing variable initialisation in...

 
 

bug #38239: missing variable initialisation in locate yields to segmentation faults

Submitted by:  None
Submitted on:  Sun 03 Feb 2013 12:01:55 PM UTC  
 
Category: NoneSeverity: 4 - Important
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Klaus AehligOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.5.11
Fixed Release: 4.5.12

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 03 Feb 2013 11:00:40 PM UTC, comment #2:

You can see that patch at

http://git.savannah.gnu.org/cgit/findutils.git/commit/?id=4b7c8a448651fe96b72fd1e48fe0003778efe85a

James Youngman <jay>
Project AdministratorIn charge of this item.
Sun 03 Feb 2013 11:00:00 PM UTC, comment #1:

Thanks for reporting the bug.

I fixed this with a slightly larger patch (commit 4b7c8a448651fe96b72fd1e48fe0003778efe85a) which also eliminates the variable they_chose_db since it was redundant.

James Youngman <jay>
Project AdministratorIn charge of this item.
Sun 03 Feb 2013 12:01:55 PM UTC, original submission:

in locate/locate.c the function dolocate uses a local variable
path_element that is never initialized if the environment
variable LOCATE_PATH is not set. Yet, in line 1886 it is accessed
via the fragment

if (path_element)
{
free (path_element);
path_element = NULL;
}

resulting in free being called with values not obtained from
malloc if, due to compiler optimisation (think -O2), the default
value is not NULL.

In the same function for the same situation (LOCATE_PATH not set),
the variable locate_path is NULL; nevertheless in line 1892,
splitstring (locate_path, path_separators, false, ...) is called,
which dereferences its first argument.

The attached patch fixes theses issues for me.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #27375:  patch-locate__locate.c added by None (625B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jay (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 24 Sep 2013 10:06:26 PM UTCjayOpen/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.5.12
    Sun 03 Feb 2013 11:00:00 PM UTCjaySeverity3 - Normal=>4 - Important
      StatusNone=>Fixed
      Assigned toNone=>jay
    Sun 03 Feb 2013 12:01:55 PM UTCNoneAttached File-=>Added patch-locate__locate.c, #27375

    Back to the top


    Powered by Savane 3.1-cleanup