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

 
 

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

Submitter:  None
Submitted:  Sun 03 Feb 2013 12:01:55 PM UTC
   
 
Category:  None Severity:  4 - Important
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Klaus Aehlig Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.5.11
Fixed Release:  4.5.12
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 03 Feb 2013 11:00:40 PM UTC, comment #2: 
James Youngman <jay>
Group administrator
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>
Group administrator
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 Files:
   
   
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
  • -email is unavailable- added by jay (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-09-24 jay Open/ClosedOpen Closed
        Fixed ReleaseNone 4.5.12
    2013-02-03 jay Severity3 - Normal 4 - Important
        StatusNone Fixed
        Assigned toNone jay
    2013-02-03 None Attached File- Added patch-locate__locate.c, #27375

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code