MT#55283 ice streams: fix Coverity Scan defect

Fixes:

*** CID 1599964:    (FORWARD_NULL)
/daemon/ice.c: 109 in ice_update_media_streams()
103
104
105     static void ice_update_media_streams(struct call_monologue *ml, sdp_streams_q *streams, sdp_sessions_q *sdp,
106                     sdp_ng_flags *flags)
107     {
108             if (!streams || !streams->head) {
>>>     CID 1599964:    (FORWARD_NULL)
>>>     Passing null pointer "streams" to "sdp_streams", which dereferences it.
109                     if (sdp_streams(sdp, streams, flags)) {
110                             ilogs(ice, LOG_WARN, "Incomplete SDP specification for tricle ICE");
111                             return;
112                     }
113             }
114
/daemon/ice.c: 115 in ice_update_media_streams()
109                     if (sdp_streams(sdp, streams, flags)) {
110                             ilogs(ice, LOG_WARN, "Incomplete SDP specification for tricle ICE");
111                             return;
112                     }
113             }
114
>>>     CID 1599964:    (FORWARD_NULL)
>>>     Dereferencing null pointer "streams".
115             for (__auto_type l = streams->head; l; l = l->next) {
116                     struct stream_params *sp = l->data;
117                     struct call_media *media = NULL;
118
119                     if (sp->media_id.len)
120                             media = g_hash_table_lookup(ml->media_ids, &sp->media_id);

Change-Id: Ic58c9c423ee17e08b42027bc68ba33f94913fd03
rfuchs/test
Richard Fuchs 7 months ago
parent b8c9684d26
commit 5f73fec33a

@ -105,7 +105,12 @@ static fragments_ht sdp_fragments;
static void ice_update_media_streams(struct call_monologue *ml, sdp_streams_q *streams, sdp_sessions_q *sdp,
sdp_ng_flags *flags)
{
if (!streams || !streams->head) {
g_auto(sdp_streams_q) streams_local = TYPED_GQUEUE_INIT;
if (!streams)
streams = &streams_local;
if (!streams->head) {
if (sdp_streams(sdp, streams, flags)) {
ilogs(ice, LOG_WARN, "Incomplete SDP specification for tricle ICE");
return;

Loading…
Cancel
Save