[asterisk-dev] [Code Review] resilient ast_copy_string()

rmudgett at digium.com rmudgett at digium.com
Thu Feb 18 12:57:35 CST 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/519/#review1538
-----------------------------------------------------------



/trunk/include/asterisk/strings.h
<https://reviewboard.asterisk.org/r/519/#comment3441>

    Include this in the then clause lest you decrement the destination before the beginning of the supplied buffer.
    
    While you're at it you can add the curly braces here per coding guidelines.


- rmudgett


On 2010-02-18 12:18:33, David Vossel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/519/
> -----------------------------------------------------------
> 
> (Updated 2010-02-18 12:18:33)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Why not check to see if the src string is NULL in ast_copy_string?  It just seems like a inexpensive check to avoid a silly crash.  If we're going to make our own string copy function why not make it resilient as well?
> 
> 
> Diffs
> -----
> 
>   /trunk/include/asterisk/strings.h 247604 
> 
> Diff: https://reviewboard.asterisk.org/r/519/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> David
> 
>




More information about the asterisk-dev mailing list