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

Friendly Automation asteriskteam at digium.com
Tue Jul 13 15:15:40 CDT 2021


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/16150 )

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:
  Sean Bright: Looks good to me, approved
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Friendly Automation: 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/+/16150
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Ie562f03c5d6c3835a3631f376b3d43e75b8f9617
Gerrit-Change-Number: 16150
Gerrit-PatchSet: 2
Gerrit-Owner: Igor Goncharovsky <igor.goncharovsky at gmail.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
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/20210713/3f955d6d/attachment-0001.html>


More information about the asterisk-code-review mailing list