[specimen] (no subject)

Eduardo Macan macan at debian.org
Tue Jan 8 05:29:53 CST 2008


Last night I uploaded specimen 0.5.2rc3 to debian, I decided to follow
the lines of Ken´s patch, but by taking a look at the code it became
apparent that freeing last_bank and being sure it was NULL was a
better approach, since this condition was checked in the
"save" function.



Juuso Wrote:

On Thursday 15 November 2007 06:51:51 Ken Restivo wrote:
>* It looks like a patch I submitted a while ago still isn't in SVN.
*>*
*>* It's kind of critical. If you don't have the fix, then if you choose New
*>* from the File menu to create a new bank, and then Save to save it, your
*>* existing saved bank will be wiped out completely off of your disk!
*>*
*>* I found this out the hard way earlier this year. I was going to try out the
*>* svn version of specimen but had to add this back in.
*>*
*>* -ken
*>* -----------
*>* --- specimen-0.5.2.rc3.orig/src/gui/bank-ops.c
*>* +++ specimen-0.5.2.rc3/src/gui/bank-ops.c
*>* @@ -140,5 +140,6 @@
*>*  int bank_ops_new ( )
*>*  {
*>*       patch_destroy_all ( );
*>* +    last_bank = strdup ("\0");
*>*       return 0;
*>*  }
*
Hi,

Thanks for the reminder. I don't remember hearing about this bug, but it sure
sounds like a nasty one.

I didn't have a look at the surrounding code yet so I might be talking out of
my ass, but your patch looks like it introduces a mem leak. Gotta be careful
with strdup(). Or is last_bank properly freed at some point before calling
bank_ops_new()?

I'll use this opportunity to poke Eric and myself about finally getting
finally out. The current code in SVN is, small discoveries such as this bug
aside, more or less ready for that purpose.

Juuso

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://zhevny.com/pipermail/specimen/attachments/20080108/2c0922b6/attachment.htm>


More information about the Specimen mailing list