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

Igor Goncharovsky asteriskteam at digium.com
Thu Jul 8 18:31:21 CDT 2021


Igor Goncharovsky has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/71/16171/1

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-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210708/ee17e901/attachment.html>


More information about the asterisk-code-review mailing list