Commit 0828f92e authored by Madaro Livio's avatar Madaro Livio Committed by Youness Alaoui
Browse files

Do not crash if the TURN server is invalid or not listening

If TURN server is not listening then nice_tcp_bsd_socket_new
returns socket=NULL and libnice crashes.
parent 016f6d56
......@@ -1428,8 +1428,15 @@ priv_add_new_candidate_discovery_turn (NiceAgent *agent,
if (socket == NULL) {
socket = nice_tcp_bsd_socket_new (agent->main_context, &turn->server);
_priv_set_socket_tos (agent, socket, stream->tos);
if (socket)
_priv_set_socket_tos (agent, socket, stream->tos);
/* The TURN server may be invalid or not listening */
if (socket == NULL)
if (turn->type == NICE_RELAY_TYPE_TURN_TLS &&
agent->compatibility == NICE_COMPATIBILITY_GOOGLE) {
socket = nice_pseudossl_socket_new (socket);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment