]> sjero.net Git - linphone/commitdiff
Add check to prevent crash.
authorGhislain MARY <ghislain.mary@belledonne-communications.com>
Wed, 19 Sep 2012 15:58:33 +0000 (17:58 +0200)
committerGhislain MARY <ghislain.mary@belledonne-communications.com>
Wed, 19 Sep 2012 15:59:48 +0000 (17:59 +0200)
coreapi/misc.c

index 6da750a0d91a8b049e55a4b5e7e64b6707e93bad..8cdf2bb27b94934e55ade9a6b3afa8acdcfe0ded 100644 (file)
@@ -694,8 +694,12 @@ void linphone_core_update_local_media_description_from_ice(SalMediaDescription *
 
        if (session_state == IS_Completed) {
                desc->ice_completed = TRUE;
-               ice_check_list_selected_valid_local_candidate(ice_session_check_list(session, 0), &rtp_addr, NULL, NULL, NULL);
-               strncpy(desc->addr, rtp_addr, sizeof(desc->addr));
+               result = ice_check_list_selected_valid_local_candidate(ice_session_check_list(session, 0), &rtp_addr, NULL, NULL, NULL);
+               if (result == TRUE) {
+                       strncpy(desc->addr, rtp_addr, sizeof(desc->addr));
+               } else {
+                       ms_warning("If ICE has completed successfully, rtp_addr should be set!");
+               }
        }
        else {
                desc->ice_completed = FALSE;