Skip to content

Commit

Permalink
MT#55283 Stop trickle updates without a room
Browse files Browse the repository at this point in the history
Don't proceed with the trickle updates in
case the required room, hence a call
hasn't been found.

Fixes Coverity Scan defect:

*** CID 1600057:  Null pointer dereferences  (NULL_RETURNS)
/daemon/janus.c: 1679 in janus_trickle()
1673            // ufrag can be given in-line or separately
1674            sp->ice_ufrag = cand->ufrag;
1675            if (!sp->ice_ufrag.len && ufrag)
1676                    bencode_strdup_str(&ngbuf->buffer, &sp->ice_ufrag, ufrag);
1677
1678            // finally do the update
>>>     CID 1600057:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be "NULL" "call" when calling "trickle_ice_update".
1679            trickle_ice_update(ngbuf, call, &flags, &streams);
1680
1681            return NULL;
1682     }
1683
1684

Change-Id: Ib2e293c2f99e914e3d02fe43d08160ec30892ae4
  • Loading branch information
zenichev committed Oct 3, 2024
1 parent 424cdf2 commit e743229
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions daemon/janus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1616,9 +1616,15 @@ static const char *janus_trickle(JsonReader *reader, struct janus_session *sessi
call_id = janus_call_id(handle->room);

struct janus_room *room = t_hash_table_lookup(janus_rooms, &handle->room);

if (room)
call = call_get(&room->call_id);
if (!room) {
*retcode = 426;
return "No such room";
}
call = call_get(&room->call_id);
if (!call) {
*retcode = 426;
return "No such room";
}
}

// set up "streams" structures to use an trickle ICE update. these must be
Expand Down

0 comments on commit e743229

Please sign in to comment.