]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] Fix possible dereference of null pointer in switch_ivr_originate() and switch_...
authorAndrey Volk <andywolk@gmail.com>
Mon, 19 Apr 2021 18:16:28 +0000 (21:16 +0300)
committerAndrey Volk <andywolk@gmail.com>
Tue, 19 Oct 2021 17:35:10 +0000 (20:35 +0300)
src/switch_ivr_originate.c

index 31ce629d40f19b87869b8664a02f690821141bfa..698b7425eaf74cc57c6228f80a0fa2a181a6dd5c 100644 (file)
@@ -1673,7 +1673,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_enterprise_originate(switch_core_sess
                        getcause = 0;
                        switch_goto_status(SWITCH_STATUS_FALSE, end);
                }
-       } else {
+       } else if (hl) {
                x_argc = hl->handle_idx;
        }
 
@@ -3487,7 +3487,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                                                        }
                                                                }
                                                        } else {
-                                                               if (switch_buffer_inuse(early_state.buffer) >= write_frame.codec->implementation->decoded_bytes_per_packet) {
+                                                               if (write_frame.codec && switch_buffer_inuse(early_state.buffer) >= write_frame.codec->implementation->decoded_bytes_per_packet) {
                                                                        write_frame.datalen = (uint32_t)switch_buffer_read(early_state.buffer, write_frame.data,
                                                                                                                                                         write_frame.codec->implementation->decoded_bytes_per_packet);
                                                                }