[svn-commits] asanders: trunk r430820 - in /trunk: ./ res/ari/resource_bridges.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jan 20 11:15:57 CST 2015


Author: asanders
Date: Tue Jan 20 11:15:54 2015
New Revision: 430820

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=430820
Log:
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

Modified:
    trunk/   (props changed)
    trunk/res/ari/resource_bridges.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/res/ari/resource_bridges.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/ari/resource_bridges.c?view=diff&rev=430820&r1=430819&r2=430820
==============================================================================
--- trunk/res/ari/resource_bridges.c (original)
+++ trunk/res/ari/resource_bridges.c Tue Jan 20 11:15:54 2015
@@ -949,16 +949,18 @@
 
 	if (bridge) {
 		/* update */
-		if (strcmp(args->name, bridge->name)) {
-			ast_ari_response_error(
-				response, 500, "Internal Error",
-				"Changing bridge name is not implemented");
-			return;
+		if (!ast_strlen_zero(args->name)) {
+			if (!strcmp(args->name, bridge->name)) {
+				ast_ari_response_error(
+					response, 500, "Internal Error",
+					"Changing bridge name is not implemented");
+				return;
+			}
 		}
 		if (!ast_strlen_zero(args->type)) {
 			ast_ari_response_error(
 				response, 500, "Internal Error",
-				"Changing bridge type is not implemented");
+				"Supplying a bridge type when updating a bridge is not allowed.");
 			return;
 		}
 		ast_ari_response_ok(response,




More information about the svn-commits mailing list