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

 
 

bug #43382: Fix double free in zfstream.cc

Submitted by:  PrasannaKumar Muralidharan <prasannatsm>
Submitted on:  Wed 08 Oct 2014 05:19:56 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: Wont FixAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

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>
Project 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 File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

     

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

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 07 Dec 2014 06:17:48 AM UTCrik5StatusNone=>Wont Fix
      Open/ClosedOpen=>Closed
    Wed 08 Oct 2014 05:19:56 PM UTCprasannatsmAttached File-=>Added fix_double_free_zfstream_cc.diff, #32241

    Back to the top


    Powered by Savane 3.1-cleanup1