From ab6af8eeeb5953dd7c74526ab6baf873ff99c332 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 24 Sep 2024 09:37:58 -0400 Subject: [PATCH] MT#55283 fix possible null dereference closes #1864 Change-Id: If222c418d4b76724ba59e5fb11aeeb2c77c7e195 (cherry picked from commit 87f9fc18bfbcfa31a265a316d348d8b938539d75) (cherry picked from commit 874eb4a079d340f762f7e509bfe6eb877251a0de) --- daemon/call.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/call.c b/daemon/call.c index 3c1be398f..c031be0f8 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -4638,7 +4638,7 @@ static int call_get_dialogue(struct call_monologue *monologues[2], call_t *call, ft = t_hash_table_lookup(call->viabranches, viabranch); /* top most subscription of tt */ if (!ft) { - struct call_media *media = tt->medias->pdata[0]; + struct call_media *media = tt->medias->len ? tt->medias->pdata[0] : NULL; if (media && media->media_subscriptions.head) { struct media_subscription * ms = media->media_subscriptions.head->data; if (ms->monologue)