List:Commits« Previous MessageNext Message »
From:Guilhem Bichot Date:November 25 2010 9:40am
Subject:Re: bzr commit into mysql-trunk-bugfixing branch (mats.kindahl:3388)
Bug#58455
View as plain text  
A precision/correction:

Guilhem Bichot a écrit, Le 25.11.2010 10:35:
> Hello Mats,
> 
> Mats Kindahl a écrit, Le 24.11.2010 15:20:
>> #At file:///home/bzr/mkindahl/testing-trunk-bugfixing/ based on 
>> revid:sergey.glukhov@stripped
>>
>>  3388 Mats Kindahl    2010-11-24
>>       Bug #58455
>>       Starting mysqld with defaults file without
>>       extension cause segmentation fault
>>             Bug occurs because fn_expand calls fn_format
>>       with NULL as ext.

>> === modified file 'mysys/mf_format.c'
>> --- a/mysys/mf_format.c    2009-04-19 01:21:33 +0000
>> +++ b/mysys/mf_format.c    2010-11-24 14:20:25 +0000
>> @@ -31,9 +31,12 @@ char * fn_format(char * to, const char *
>>    reg1 size_t length;
>>    size_t dev_length;
>>    DBUG_ENTER("fn_format");
>> +  DBUG_ASSERT(name != NULL);
>> +  DBUG_ASSERT(extension != NULL);
>>    DBUG_PRINT("enter",("name: %s  dir: %s  extension: %s  flag: %d",
>>                 name,dir,extension,flag));
>>  
>> +
>>    /* Copy and skip directory */
>>    name+=(length=dirname_part(dev, (startpos=(char *) name), 
>> &dev_length));
>>    if (length == 0 || (flag & MY_REPLACE_DIR))
> 
> Two suggestions while you're in this function:
> - add in the function comment of fn_expand(), that it allocates memory 
> (which will thus have to be freed).
> - "DBUG_ASSERT(result_path!=NULL)" could be removed, as it's preceded by
> if (... (result_path=...)==NULL) DBUG_RETURN

Strangely I see neither this if(result_path==NULL) nor the 
DBUG_ASSERT(result_path!=NULL) in the patch, so maybe it was removed in 
a recent revision and I'm looking at a too old tree. So, you may have to 
ignore my suggestion.

Thread
bzr commit into mysql-trunk-bugfixing branch (mats.kindahl:3388) Bug#58455Mats Kindahl24 Nov
Re: bzr commit into mysql-trunk-bugfixing branch (mats.kindahl:3388)Bug#58455Magnus BlĂ„udd24 Nov
  • Re: bzr commit into mysql-trunk-bugfixing branch (mats.kindahl:3388)Bug#58455Mats Kindahl24 Nov
Re: bzr commit into mysql-trunk-bugfixing branch (mats.kindahl:3388)Bug#58455Guilhem Bichot25 Nov
  • Re: bzr commit into mysql-trunk-bugfixing branch (mats.kindahl:3388)Bug#58455Guilhem Bichot25 Nov
  • Re: bzr commit into mysql-trunk-bugfixing branch (mats.kindahl:3388)Bug#58455Mats Kindahl26 Nov
  • Re: bzr commit into mysql-trunk-bugfixing branch (mats.kindahl:3388)Bug#58455Mats Kindahl26 Nov
Re: bzr commit into mysql-trunk-bugfixing branch(mats.kindahl:3388) Bug#58455Bjorn Munch25 Nov