res_ari: Fix audiosocket segfault

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

ASTERISK-29514 #close

Change-Id: Ie562f03c5d6c3835a3631f376b3d43e75b8f9617
This commit is contained in:
Igor Goncharovsky 2021-07-08 20:32:20 +06:00 committed by Friendly Automation
parent 146b59df3f
commit b9bb96ffed
1 changed files with 5 additions and 0 deletions

View File

@ -2134,6 +2134,11 @@ static void external_media_audiosocket_tcp(struct ast_ari_channels_external_medi
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 */