From 856ab8e5169294b9389ccfe3565528de6e1804e4 Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Wed, 12 Oct 2016 18:54:02 +0900 Subject: [PATCH] Add file name checker and Fix ttse_send_result Change-Id: I8ea6e326289fd1b325d9264a77531cedece21e0c Signed-off-by: sooyeon.kim --- common/tts_config_mgr.c | 6 ++++++ server/ttse.c | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/common/tts_config_mgr.c b/common/tts_config_mgr.c index 1304fc0..3d7e18c 100755 --- a/common/tts_config_mgr.c +++ b/common/tts_config_mgr.c @@ -771,6 +771,9 @@ int __tts_config_mgr_get_engine_info() } if (NULL != dirp) { + if (!strcmp(".", dirp->d_name) || !strcmp("..", dirp->d_name)) + continue; + filesize = strlen(TTS_DEFAULT_ENGINE_INFO) + strlen(dirp->d_name) + 2; if (filesize >= 512) { SECURE_SLOG(LOG_ERROR, tts_tag(), "[CONFIG ERROR] File path is too long : %s", dirp->d_name); @@ -810,6 +813,9 @@ int __tts_config_mgr_get_engine_info() } if (NULL != dirp) { + if (!strcmp(".", dirp->d_name) || !strcmp("..", dirp->d_name)) + continue; + filesize = strlen(TTS_DOWNLOAD_ENGINE_INFO) + strlen(dirp->d_name) + 2; if (filesize >= 512) { SECURE_SLOG(LOG_ERROR, tts_tag(), "[CONFIG ERROR] File path is too long : %s", dirp->d_name); diff --git a/server/ttse.c b/server/ttse.c index d5ab9e9..01eb7f0 100755 --- a/server/ttse.c +++ b/server/ttse.c @@ -154,7 +154,6 @@ int ttse_send_result(ttse_result_event_e event, const void* data, unsigned int d if (NULL == data) { SLOG(LOG_ERROR, tts_tag(), "[ERROR] Input parameter is null"); - return TTSE_ERROR_INVALID_PARAMETER; } ret = ttsd_send_result(event, data, data_size, audio_type, rate, user_data); -- 2.7.4