[svn-commits] file: branch 12 r400401 - /branches/12/res/ari/resource_channels.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Oct 3 14:05:38 CDT 2013


Author: file
Date: Thu Oct  3 14:05:36 2013
New Revision: 400401

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=400401
Log:
Fix a crash caused by muting and unmuting a channel in ARI without specifying a direction.

(closes issue ASTERISK-22637)
Reported by: Scott Griepentrog

Patch by Matt Jordan, whose office I have taken over in the name of Canada.

Modified:
    branches/12/res/ari/resource_channels.c

Modified: branches/12/res/ari/resource_channels.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/ari/resource_channels.c?view=diff&rev=400401&r1=400400&r2=400401
==============================================================================
--- branches/12/res/ari/resource_channels.c (original)
+++ branches/12/res/ari/resource_channels.c Thu Oct  3 14:05:36 2013
@@ -152,6 +152,13 @@
 		return;
 	}
 
+	if (ast_strlen_zero(args->direction)) {
+		ast_ari_response_error(
+			response, 400, "Bad Request",
+			"Direction is required");
+		return;
+	}
+
 	if (!strcmp(args->direction, "in")) {
 		direction = AST_MUTE_DIRECTION_READ;
 	} else if (!strcmp(args->direction, "out")) {
@@ -178,6 +185,13 @@
 
 	control = find_control(response, args->channel_id);
 	if (control == NULL) {
+		return;
+	}
+
+	if (ast_strlen_zero(args->direction)) {
+		ast_ari_response_error(
+			response, 400, "Bad Request",
+			"Direction is required");
 		return;
 	}
 




More information about the svn-commits mailing list