[asterisk-dev] [Code Review] Allow quoting and escaping within application options with arguments

Tilghman Lesher tlesher at digium.com
Tue Apr 6 10:07:08 CDT 2010



> On 2010-04-05 07:36:38, Sean Bright wrote:
> > /trunk/main/app.c, line 1843
> > <https://reviewboard.asterisk.org/r/604/diff/2/?file=9110#file9110line1843>
> >
> >     The manpage for memccpy says:
> >     
> >     "If the memory areas overlap, the results are undefined."
> 
> Tilghman Lesher wrote:
>     Hmmm, that wasn't on the manpage I was looking at.  I suppose ast_copy_string with an INT_MAX 3rd argument would probably work, though.  The main thing I'm looking at here is that the length argument is not strictly needed, and I'd rather not do the strlen operation if it can be avoided.
> 
> amorsen wrote:
>     The size isn't the size of the argument, it's the size of the destination, hence doing strlen wouldn't make sense anyway. It sounds fairly dangerous to copy into a buffer of unknown size -- how does the code guarantee that it will fit?

It's a NULL-terminated argument.  In this function, you don't have an indication of the length of the buffer, anyway.


- Tilghman


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


On 2010-04-05 00:03:51, Tilghman Lesher wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/604/
> -----------------------------------------------------------
> 
> (Updated 2010-04-05 00:03:51)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Original description of the issue is:
> 
> f-option of Dial()-application cannot handle '(' or ')' characters in passed CALLERID-parameter
> 
> 
> Diffs
> -----
> 
>   /trunk/include/asterisk/app.h 255795 
>   /trunk/main/app.c 255795 
>   /trunk/tests/test_app.c 255795 
> 
> Diff: https://reviewboard.asterisk.org/r/604/diff
> 
> 
> Testing
> -------
> 
> Test written to verify behavior.
> 
> 
> Thanks,
> 
> Tilghman
> 
>




More information about the asterisk-dev mailing list