bugGNU Octave - Bugs: bug #43382, Fix double free in zfstream.cc

 
 

bug #43382: Fix double free in zfstream.cc

Submitter:  PrasannaKumar Muralidharan <prasannatsm>
Submitted:  Wed 08 Oct 2014 05:19:56 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Wont Fix Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 09 Oct 2014 06:35:21 AM UTC, comment #2: 

Trusted false positive from static analyser. Did not go through the code enough. Sorry for the noise.

The patch still has some use. It avoids the call to disable_buffer second time which is not necessary.

PrasannaKumar Muralidharan <prasannatsm>
Wed 08 Oct 2014 06:21:48 PM UTC, comment #1: 

I don't see how the buffer can be freed twice.  The call to delete only happens if buffer is non-zero, and after calling delete[] on buffer, buffer is set to 0.  Also, calling delete[] on 0 doesn't actually do anything, does it?  Am I missing something?

If I am missing something and this actually does cause a segfault or double free to occur, can you please provide a test case for that?

John W. Eaton <jwe>
Group administrator
Wed 08 Oct 2014 05:19:56 PM UTC, original submission:  

In gzfilebuf's destructor disable_buffer() is called after calling close(). In close method disable_buffer() is called. This causes buffers to be freed twice. Attached patch fixes this.

PrasannaKumar Muralidharan <prasannatsm>

 

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

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by prasannatsm (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 group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-12-07 rik5 StatusNone Wont Fix
        Open/ClosedOpen Closed
    2014-10-08 prasannatsm Attached File- Added fix_double_free_zfstream_cc.diff, #32241

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code