提交 fc02be8d authored 作者: Mike Jerris's avatar Mike Jerris

Merge pull request #1637 in FS/freeswitch from…

Merge pull request #1637 in FS/freeswitch from ~DRAGOS_OANCEA/freeswitch-dragos:bugfix/FS-11559-ivr_record_file-nullptr to master

* commit '15051696':
  FS-11559: check file name null ptr (crashfix CoreSession:recordFile)
...@@ -1278,6 +1278,7 @@ SWITCH_DECLARE(int) CoreSession::recordFile(char *file_name, int time_limit, int ...@@ -1278,6 +1278,7 @@ SWITCH_DECLARE(int) CoreSession::recordFile(char *file_name, int time_limit, int
this_check(-1); this_check(-1);
sanity_check(-1); sanity_check(-1);
if (!file_name) return 0;
memset(&local_fh, 0, sizeof(local_fh)); memset(&local_fh, 0, sizeof(local_fh));
fhp = &local_fh; fhp = &local_fh;
local_fh.thresh = silence_threshold; local_fh.thresh = silence_threshold;
......
...@@ -390,6 +390,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se ...@@ -390,6 +390,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
if (!file) {
return SWITCH_STATUS_FALSE;
}
prefix = switch_channel_get_variable(channel, "sound_prefix"); prefix = switch_channel_get_variable(channel, "sound_prefix");
if (!prefix) { if (!prefix) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论