[asterisk-dev] [asterisk-commits] tilghman: trunk r228798 - in /trunk: addons/channels/ main/ res/

Mark Michelson mmichelson at digium.com
Mon Nov 9 10:34:52 CST 2009


Alec Davis wrote:
> Tilghman.
> trunk/addons/cdr_mysql.c
> 
> Although changed, going by the diff attached here doesn't appear any
> different?
> But the commit comment suggests that it should be.
> 
> Alec
>  

I think Tilghman's commit message explains the problem quite well. The change 
was to call ast_str_set prior to assigning the variable *field to us->str. The 
reason for the change is that ast_str_set can call realloc. If you point us->str 
to *field and then call ast_str_set, then *field can be realloced, causing 
us->str to point to invalid memory.

Mark Michelson



More information about the asterisk-dev mailing list