From: Dragos Oancea Date: Tue, 11 Dec 2018 05:18:47 +0000 (-0500) Subject: FS-11559: check file name null ptr (crashfix CoreSession:recordFile) X-Git-Tag: v1.8.3~1^2~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15051696d1467f339a74f6747a8776737dc9210d;p=thirdparty%2Ffreeswitch.git FS-11559: check file name null ptr (crashfix CoreSession:recordFile) --- diff --git a/src/switch_cpp.cpp b/src/switch_cpp.cpp index d703bbdc31..d2a7a531f8 100644 --- a/src/switch_cpp.cpp +++ b/src/switch_cpp.cpp @@ -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; diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index 911d557796..abc028852d 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -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) {