ARI: Fixed crash that occurred when updating a bridge when the optional query parameter 'name' was not supplied.

Prior to this changeset, posting to the: /ari/bridges/{bridgeId} endpoint without specifying a value for the [name] query parameter, would crash Asterisk if the bridge you are attempting to create (or update) had the same ID as an existing bridge. The internal mechanism of the POST operation interpreted a null value for name, thus resulting in an error condition that crashed Asterisk.

ASTERISK-24560 #close
Reported By: Kinsey Moore

Review: https://reviewboard.asterisk.org/r/4349/
........

Merged revisions 430818 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
changes/42/42/1
Ashley Sanders 11 years ago
parent e4738a59eb
commit 804ab70f9d

@ -949,16 +949,18 @@ void ast_ari_bridges_create_or_update_with_id(struct ast_variable *headers,
if (bridge) { if (bridge) {
/* update */ /* update */
if (strcmp(args->name, bridge->name)) { if (!ast_strlen_zero(args->name)) {
ast_ari_response_error( if (!strcmp(args->name, bridge->name)) {
response, 500, "Internal Error", ast_ari_response_error(
"Changing bridge name is not implemented"); response, 500, "Internal Error",
return; "Changing bridge name is not implemented");
return;
}
} }
if (!ast_strlen_zero(args->type)) { if (!ast_strlen_zero(args->type)) {
ast_ari_response_error( ast_ari_response_error(
response, 500, "Internal Error", response, 500, "Internal Error",
"Changing bridge type is not implemented"); "Supplying a bridge type when updating a bridge is not allowed.");
return; return;
} }
ast_ari_response_ok(response, ast_ari_response_ok(response,

Loading…
Cancel
Save