]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
avoid seg on invalid params to record app.(MODAPP-63)
authorMichael Jerris <mike@jerris.com>
Sat, 29 Dec 2007 23:15:57 +0000 (23:15 +0000)
committerMichael Jerris <mike@jerris.com>
Sat, 29 Dec 2007 23:15:57 +0000 (23:15 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7026 d0543943-73ff-0310-b7d9-9358b9ac24b2

Freeswitch.2008.sln
src/include/switch_core.h
src/include/switch_ivr.h
src/mod/applications/mod_dptools/mod_dptools.c
src/switch_core_file.c
src/switch_ivr_play_say.c

index bc1e80b600947468953fc1e7b87f2daa6a61f93a..14f8617c07401b3f388c51b0bb41bcfea0d5e667 100644 (file)
@@ -115,6 +115,7 @@ EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan", "dialplan", "{C7E2382E-2C22-4D18-BF93-80C6A1FFA7AC}"\r
        ProjectSection(SolutionItems) = preProject\r
                conf\dialplan\default.xml = conf\dialplan\default.xml\r
+               conf\dialplan\public.xml = conf\dialplan\public.xml\r
        EndProjectSection\r
 EndProject\r
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory", "directory", "{FC71C66E-E268-4EAD-B1F5-F008DC382E83}"\r
index c05100c3064ff063a172276c91714d5b80771338..ce5e42bd0933d7accb12e8ffe90498c5629accef 100644 (file)
@@ -1126,7 +1126,7 @@ SWITCH_DECLARE(void) switch_core_db_test_reactive(switch_core_db_t *db, char *te
   \note the loadable module used is chosen based on the file extension
 */
 SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh,
-                                                                                                         const char *file_path, uint8_t channels, uint32_t rate, unsigned int flags, switch_memory_pool_t *pool);
+                                                                                                         _In_z_ const char *file_path, uint8_t channels, uint32_t rate, unsigned int flags, switch_memory_pool_t *pool);
 /*! 
   \brief Read media from a file handle
   \param fh the file handle to read from (must be initilized by you memset all 0 for read, fill in channels and rate for write)
index b6ce42ace24872d571b185f1c9e2d2f554763bf7..acdb4ff72c72083c5664f4584d2ce35e03ed4768 100644 (file)
@@ -298,8 +298,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *sessi
   \param limit max limit to record for (0 for infinite)
   \return SWITCH_STATUS_SUCCESS if all is well
 */
-SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *session,
-                                                                                                          switch_file_handle_t *fh, char *file, switch_input_args_t *args, uint32_t limit);
+SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(_In_ switch_core_session_t *session,
+                                                                                                          _In_ switch_file_handle_t *fh,
+                                                                                                          _In_z_ const char *file,
+                                                                                                          _In_opt_ switch_input_args_t *args,
+                                                                                                          _In_ uint32_t limit);
 
 
 /*!
index f5ccf384f61a41d4ff1bdf61b783640a40d6c27f..1c3adbbfe48746a72ea2d1d9a5461876999cd4d2 100644 (file)
@@ -1253,7 +1253,7 @@ SWITCH_STANDARD_APP(record_function)
        int rate;
 
        channel = switch_core_session_get_channel(session);
-       assert(channel != NULL);
+       switch_assert(channel != NULL);
        
        if (data && (mydata = switch_core_session_strdup(session, data))) {
                argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
index 6ed1f2a459d405d7c951fa8b6ebf71a4a367d047..02cf3ffe67591559446ad135e5be61d7a649ba4c 100644 (file)
@@ -42,6 +42,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh,
        char stream_name[128] = "";
        char *rhs = NULL;
 
+       if (switch_strlen_zero(file_path)) {
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Filename\n");
+               return SWITCH_STATUS_FALSE;
+       }
+
        if ((rhs = strstr(file_path, SWITCH_URL_SEPARATOR))) {
                switch_copy_string(stream_name, file_path, (rhs + 1) - file_path);
                ext = stream_name;
index 51f3b01d9d86826025b74470b98def3ccdb35cd9..b083fbc101f92ddd0bbcc37b68a32171b69150a6 100644 (file)
@@ -335,7 +335,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *s
 }
 
 SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *session,
-                                                                                                          switch_file_handle_t *fh, char *file, switch_input_args_t *args, uint32_t limit)
+                                                                                                          switch_file_handle_t *fh, const char *file, switch_input_args_t *args, uint32_t limit)
 {
        switch_channel_t *channel;
        switch_dtmf_t dtmf = {0};