FS-11559: check file name null ptr (crashfix CoreSession:recordFile)

This commit is contained in:
Dragos Oancea 2018-12-11 00:18:47 -05:00
parent cae7f0fa2f
commit 15051696d1
2 changed files with 5 additions and 0 deletions

View File

@ -1278,6 +1278,7 @@ SWITCH_DECLARE(int) CoreSession::recordFile(char *file_name, int time_limit, int
this_check(-1);
sanity_check(-1);
if (!file_name) return 0;
memset(&local_fh, 0, sizeof(local_fh));
fhp = &local_fh;
local_fh.thresh = silence_threshold;

View File

@ -390,6 +390,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
return SWITCH_STATUS_FALSE;
}
if (!file) {
return SWITCH_STATUS_FALSE;
}
prefix = switch_channel_get_variable(channel, "sound_prefix");
if (!prefix) {