[Core] Fix possible dereference of null pointer in switch_ivr_originate() and switch_ivr_enterprise_originate()

This commit is contained in:
Andrey Volk 2021-04-19 21:16:28 +03:00
parent 4b03a47a7f
commit 67048377c4
1 changed files with 2 additions and 2 deletions

View File

@ -1673,7 +1673,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_enterprise_originate(switch_core_sess
getcause = 0; getcause = 0;
switch_goto_status(SWITCH_STATUS_FALSE, end); switch_goto_status(SWITCH_STATUS_FALSE, end);
} }
} else { } else if (hl) {
x_argc = hl->handle_idx; x_argc = hl->handle_idx;
} }
@ -3487,7 +3487,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
} }
} }
} else { } 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.datalen = (uint32_t)switch_buffer_read(early_state.buffer, write_frame.data,
write_frame.codec->implementation->decoded_bytes_per_packet); write_frame.codec->implementation->decoded_bytes_per_packet);
} }