]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
CID:1214192 Dereference after null check, don't crash when no file name passed on...
authorMichael Jerris <mike@jerris.com>
Thu, 15 May 2014 13:37:26 +0000 (13:37 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 15 May 2014 13:37:26 +0000 (13:37 +0000)
src/mod/applications/mod_httapi/mod_httapi.c

index b33a7ef7fe6bcc8764f7dd158410b62c7d69a367..3c549c60e02b5e6d716b5c24221d86cceb0f27de 100644 (file)
@@ -2828,6 +2828,11 @@ static switch_status_t file_open(switch_file_handle_t *handle, const char *path,
                        }       
                }
 
+               if (!context->write.file_name) {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No file name specified.\n");
+                       return SWITCH_STATUS_GENERR;
+               }
+
                if ((ext = strrchr(context->write.file_name, '.'))) {
                        ext++;
                } else {