Commit e55e2cd7 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Prevent crash with null pointer.

parent 243cc4d3
...@@ -1793,20 +1793,22 @@ static void ice_handle_received_binding_response(IceCheckList *cl, RtpSession *r ...@@ -1793,20 +1793,22 @@ static void ice_handle_received_binding_response(IceCheckList *cl, RtpSession *r
IceStunServerCheckTransaction *transaction; IceStunServerCheckTransaction *transaction;
IceStunServerCheck *check = (IceStunServerCheck *)elem->data; IceStunServerCheck *check = (IceStunServerCheck *)elem->data;
elem = ms_list_find_custom(check->transactions, (MSCompareFunc) ice_compare_transactionIDs, &msg->msgHdr.tr_id); elem = ms_list_find_custom(check->transactions, (MSCompareFunc) ice_compare_transactionIDs, &msg->msgHdr.tr_id);
transaction = (IceStunServerCheckTransaction *)elem->data; if (elem != NULL) {
if (transaction != NULL) { transaction = (IceStunServerCheckTransaction *)elem->data;
componentID = ice_get_componentID_from_rtp_session(evt_data); if (transaction != NULL) {
if ((componentID > 0) && (ice_parse_stun_server_binding_response(msg, addr, sizeof(addr), &port) >= 0)) { componentID = ice_get_componentID_from_rtp_session(evt_data);
base_elem = ms_list_find_custom(cl->local_candidates, (MSCompareFunc)ice_find_host_candidate, &componentID); if ((componentID > 0) && (ice_parse_stun_server_binding_response(msg, addr, sizeof(addr), &port) >= 0)) {
if (base_elem != NULL) { base_elem = ms_list_find_custom(cl->local_candidates, (MSCompareFunc)ice_find_host_candidate, &componentID);
candidate = (IceCandidate *)base_elem->data; if (base_elem != NULL) {
ice_add_local_candidate(cl, "srflx", addr, port, componentID, candidate); candidate = (IceCandidate *)base_elem->data;
ms_message("ice: Add candidate obtained by STUN: %s:%u:srflx", addr, port); ice_add_local_candidate(cl, "srflx", addr, port, componentID, candidate);
ms_message("ice: Add candidate obtained by STUN: %s:%u:srflx", addr, port);
}
transaction->response_time = evt_data->ts;
check->responded = TRUE;
} }
transaction->response_time = evt_data->ts; stun_server_response = TRUE;
check->responded = TRUE;
} }
stun_server_response = TRUE;
} }
} }
if (ms_list_find_custom(cl->stun_server_checks, (MSCompareFunc)ice_find_non_responded_stun_server_check, NULL) == NULL) { if (ms_list_find_custom(cl->stun_server_checks, (MSCompareFunc)ice_find_non_responded_stun_server_check, NULL) == NULL) {
......
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