[asterisk-dev] [Code Review] 4349: Asterisk: Creating a named ARI bridge twice causes a crash
rmudgett
reviewboard at asterisk.org
Thu Jan 15 18:58:56 CST 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4349/#review14208
-----------------------------------------------------------
./branches/13/include/asterisk/strings.h
<https://reviewboard.asterisk.org/r/4349/#comment24661>
The retvals for this function are
< 0 if s1 comes before s2
= 0 if s1 is the same as s2
> 0 if s2 follows s2
strcmp() does not always return -1 if s1 < s2
strcmp() returns *s1 - *s2 if it is nonzero
./branches/13/res/ari/resource_bridges.c
<https://reviewboard.asterisk.org/r/4349/#comment24662>
ast_null_safe_strcmp() is not really needed here. You have just checked to see if the args->name string is not empty and the bridge->name can never be NULL since it is a stringfield.
- rmudgett
On Jan. 15, 2015, 4:44 p.m., Ashley Sanders wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4349/
> -----------------------------------------------------------
>
> (Updated Jan. 15, 2015, 4:44 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Bugs: ASTERISK-24560
> https://issues.asterisk.org/jira/browse/ASTERISK-24560
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> Currently in ARI (Asterisk REST Interface), posting to the: /ari/bridges/{bridgeId} endpoint without specifying a value for the [name] query parameter, will crash Asterisk if the bridge you are attempting to create (or update) has the same ID as an existing bridge. The internal mechanism of the POST operation interprets a null value for name, thus resulting in an error condition that crashes Asterisk.
>
> The first step in resolving this was to construct tests to ensure that Asterisk behaves as expected when submitting requests for creating a new bridge when a bridge with the same ID already exists in memory. The expected behavior is to reject such requests and return an HTTP status code of 500 (Internal Server Error).
>
> You can find the review for the test suite at: https://reviewboard.asterisk.org/r/4348
>
>
> Diffs
> -----
>
> ./branches/13/res/ari/resource_bridges.c 430163
> ./branches/13/main/strings.c 430163
> ./branches/13/include/asterisk/strings.h 430163
>
> Diff: https://reviewboard.asterisk.org/r/4349/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Ashley Sanders
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150116/94fcb841/attachment.html>
More information about the asterisk-dev
mailing list