Skip to content

Commit

Permalink
Added more checks on nice_address_set_from_string (fixes #1973) (#1981)
Browse files Browse the repository at this point in the history
  • Loading branch information
mp16 authored Mar 6, 2020
1 parent 6c025d4 commit 9386afb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,11 +796,15 @@ int janus_sdp_parse_candidate(void *ice_stream, const char *candidate, int trick
c->password = g_strdup(stream->rpass);
if(c->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE || c->type == NICE_CANDIDATE_TYPE_PEER_REFLEXIVE) {
added = nice_address_set_from_string(&c->base_addr, rrelip);
nice_address_set_port(&c->base_addr, rrelport);
if(added)
nice_address_set_port(&c->base_addr, rrelport);

} else if(c->type == NICE_CANDIDATE_TYPE_RELAYED) {
/* FIXME Do we really need the base address for TURN? */
added = nice_address_set_from_string(&c->base_addr, rrelip);
nice_address_set_port(&c->base_addr, rrelport);
if(added)
nice_address_set_port(&c->base_addr, rrelport);

}
if(!added) {
JANUS_LOG(LOG_WARN, "[%"SCNu64"] Invalid base address '%s', skipping %s candidate (%s)\n",
Expand Down

0 comments on commit 9386afb

Please sign in to comment.