[Asterisk-code-review] res_ari: Fix audiosocket segfault (asterisk[master])

George Joseph asteriskteam at digium.com
Wed Jul 14 08:20:25 CDT 2021


George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/16171 )

Change subject: res_ari: Fix audiosocket segfault
......................................................................

res_ari: Fix audiosocket segfault

Add check that data parameter specified when audiosocket used for externalMedia.

ASTERISK-29514 #close

Change-Id: Ie562f03c5d6c3835a3631f376b3d43e75b8f9617
---
M res/ari/resource_channels.c
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Sean Bright: Looks good to me, approved
  George Joseph: Approved for Submit



diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c
index 31856dc..a3d0f31 100644
--- a/res/ari/resource_channels.c
+++ b/res/ari/resource_channels.c
@@ -2134,6 +2134,11 @@
 	struct ast_channel *chan;
 	struct varshead *vars;
 
+	if (ast_strlen_zero(args->data)) {
+		ast_ari_response_error(response, 400, "Bad Request", "data can not be empty");
+		return;
+	}
+
 	endpoint_len = strlen("AudioSocket/") + strlen(args->external_host) + 1 + strlen(args->data) + 1;
 	endpoint = ast_alloca(endpoint_len);
 	/* The UUID is stored in the arbitrary data field */

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16171
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ie562f03c5d6c3835a3631f376b3d43e75b8f9617
Gerrit-Change-Number: 16171
Gerrit-PatchSet: 1
Gerrit-Owner: Igor Goncharovsky <igor.goncharovsky at gmail.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210714/f162c5c9/attachment.html>


More information about the asterisk-code-review mailing list