From b53fc3fa09328ce7803b259ba8d3b2a02fd47bdd Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 7 Apr 2023 08:21:29 -0400 Subject: [PATCH] MT#56447 fix list pointer check Check for EOL in the right places. Change-Id: Ib9b9b1e08c585f3865a1c8ab0146b8a3eb3c7e39 Warned-by: Coverity (cherry picked from commit 4e908d812836a580fc6327ecac962590e3ac3ea6) --- daemon/call.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 6ef9b4f7c5..97568e8c9b 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -3491,6 +3491,9 @@ int monologue_subscribe_answer(struct call_monologue *dst_ml, struct sdp_ng_flag bool transcoding = false; for (GList *l = streams->head; l; l = l->next) { + if (!src_ml_it) + return -1; + struct stream_params *sp = l->data; // grab the matching source ml: @@ -3498,10 +3501,10 @@ int monologue_subscribe_answer(struct call_monologue *dst_ml, struct sdp_ng_flag // the current source ml if (src_media_it && !src_media_it->next) { src_ml_it = src_ml_it->next; + if (!src_ml_it) + return -1; index = 1; // starts over at 1 } - if (!src_ml_it) - return -1; struct call_subscription *cs = src_ml_it->data; struct call_monologue *src_ml = cs->monologue;