MT#57719 Fix defect spotted by Coverity Scan (85fc7ff)

*** CID 1570963:  Null pointer dereferences  (REVERSE_INULL)
/daemon/call.c: 3553 in monologue_subscribe_answer()
3547     		/* set src_media based on subscription (assuming it is one-to-one) */
3548     		struct call_media * dst_media = __get_media(dst_ml, sp, flags, 0);
3549     		GList * src_ml_media_it = dst_media->media_subscriptions.head;
3550     		struct media_subscription * ms = src_ml_media_it->data;
3551     		struct call_media * src_media = ms->media;
3552
>>>     CID 1570963:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "dst_media" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
3553     		if (!dst_media || !src_media)
3554     			continue;
3555
3556     		/* additional attributes to be carried for `sdp_create()` */
3557     		if (print_extra_sess_attrs && !g_queue_find(&attr_mls, ms->monologue)) {
3558     			sdp_copy_session_attributes(ms->monologue, dst_ml);

Change-Id: I391b95f61237e5a7af206b0568a1cf421dcbb8f8
pull/1755/head
Donat Zenichev 2 years ago
parent 6a792f2bdf
commit da134849e8

@ -3413,16 +3413,19 @@ int monologue_subscribe_answer(struct call_monologue *dst_ml, struct sdp_ng_flag
for (GList * l = streams->head; l; l = l->next)
{
struct stream_params * sp = l->data;
struct call_media * dst_media = __get_media(dst_ml, sp, flags, 0);
if (!dst_media)
continue;
/* set src_media based on subscription (assuming it is one-to-one)
* TODO: this should probably be reworked to support one-to-multi subscriptions.
*/
struct call_media * dst_media = __get_media(dst_ml, sp, flags, 0);
GList * src_ml_media_it = dst_media->media_subscriptions.head;
struct media_subscription * ms = src_ml_media_it->data;
struct call_media * src_media = ms->media;
if (!dst_media || !src_media)
if (!src_media)
continue;
/* additional attributes to be carried for `sdp_create()` */

Loading…
Cancel
Save