]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11559: check file name null ptr (crashfix CoreSession:recordFile)
authorDragos Oancea <dragos@signalwire.com>
Tue, 11 Dec 2018 05:18:47 +0000 (00:18 -0500)
committerDragos Oancea <dragos@signalwire.com>
Mon, 17 Dec 2018 09:30:51 +0000 (04:30 -0500)
src/switch_cpp.cpp
src/switch_ivr_play_say.c

index d703bbdc318aa3a08d6beaf35cba35e1cea55726..d2a7a531f8574ad4ce6be8fc0b85dc0e7feca73f 100644 (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;
index 911d557796e7344d1c6d4a1237d90a51a2172537..abc028852d9f63f474552aab2e63595f77cbe32f 100644 (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) {