]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10534 [mod_loopback] Add null pointer check to avoid crashing loopbacks
authorVladimir Ralev <vladimir.ralev@gmail.com>
Thu, 8 Nov 2018 21:59:59 +0000 (23:59 +0200)
committerVladimir Ralev <vladimir.ralev@gmail.com>
Tue, 20 Nov 2018 21:32:36 +0000 (23:32 +0200)
src/mod/endpoints/mod_loopback/mod_loopback.c

index 1ef3690578601f89c92bbd056ad0fd91beb9569b..73cc0802669d4b834db7eabcdb86d85d391c57a1 100644 (file)
@@ -831,7 +831,7 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
        if (switch_test_flag(frame, SFF_CNG) ||
                (switch_test_flag(tech_pvt, TFLAG_BOWOUT) && switch_test_flag(tech_pvt, TFLAG_BOWOUT_USED))) {
                switch_core_timer_sync(&tech_pvt->timer);
-               switch_core_timer_sync(&tech_pvt->other_tech_pvt->timer);
+               if (tech_pvt->other_tech_pvt) switch_core_timer_sync(&tech_pvt->other_tech_pvt->timer);
                return SWITCH_STATUS_SUCCESS;
        }
 
@@ -991,10 +991,10 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
 
                        done = 1;
                        switch_set_flag(tech_pvt, TFLAG_CLEAR);
-                       switch_set_flag(tech_pvt->other_tech_pvt, TFLAG_CLEAR);
+                       if (tech_pvt->other_tech_pvt) switch_set_flag(tech_pvt->other_tech_pvt, TFLAG_CLEAR);
 
                        switch_core_timer_sync(&tech_pvt->timer);
-                       switch_core_timer_sync(&tech_pvt->other_tech_pvt->timer);
+                       if (tech_pvt->other_tech_pvt) switch_core_timer_sync(&tech_pvt->other_tech_pvt->timer);
                }
                break;
        default: