From: Wonnam Jang Date: Tue, 4 Oct 2016 07:19:55 +0000 (-0700) Subject: Merge "Fix passing parameter after null" into tizen X-Git-Tag: accepted/tizen/3.0/ivi/20161011.065128^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=382e722c5df1397ac181d7af4a49e3fe33623035;hp=bbd1f9ca2c02587e4ca7423507e9e2d8299f9239;p=platform%2Fcore%2Fuifw%2Ftts.git Merge "Fix passing parameter after null" into tizen --- diff --git a/common/tts_config_mgr.c b/common/tts_config_mgr.c old mode 100644 new mode 100755 index 8a54868..1304fc0 --- a/common/tts_config_mgr.c +++ b/common/tts_config_mgr.c @@ -942,12 +942,16 @@ static int __tts_config_mgr_register_engine_config_updated_event(const char* pat SLOG(LOG_DEBUG, tts_tag(), "Add inotify watch(%s)", path); if (ino->dir_wd < 0) { SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to add watch"); + free(ino); + ino = NULL; return -1; } ino->dir_fd_handler = ecore_main_fd_handler_add(ino->dir_fd, ECORE_FD_READ, (Ecore_Fd_Cb)__tts_config_mgr_engine_config_inotify_event_callback, (void *)ino, NULL, NULL); if (NULL == ino->dir_fd_handler) { SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to add fd handler"); + free(ino); + ino = NULL; return -1; } @@ -1394,7 +1398,7 @@ int __tts_set_buxtonkey(const char* engine) SLOG(LOG_ERROR, tts_tag(), "[DBUS-BUXTON2] buxton_open failed!! (%d)", ret); return TTS_CONFIG_ERROR_OPERATION_FAILED; } - bux_layer = buxton_create_layer("user"); + bux_layer = buxton_create_layer("system"); if (NULL == bux_layer) { SLOG(LOG_ERROR, tts_tag(), "[DBUS-BUXTON2] buxton_create_layer FAIL"); buxton_close(bux_cli); diff --git a/common/tts_config_parser.c b/common/tts_config_parser.c old mode 100644 new mode 100755 index 9de67eb..6df067b --- a/common/tts_config_parser.c +++ b/common/tts_config_parser.c @@ -137,7 +137,6 @@ int tts_parser_get_engine_info(const char* path, tts_engine_info_s** engine_info while (NULL != voice_node) { if (0 == xmlStrcmp(voice_node->name, (const xmlChar *)TTS_TAG_ENGINE_VOICE)) { - tts_config_voice_s* temp_voice = (tts_config_voice_s*)calloc(1, sizeof(tts_config_voice_s)); if (NULL == temp_voice) { SLOG(LOG_ERROR, tts_tag(), "[ERROR] Out of memory"); diff --git a/engine-parser/src/tts-engine-parser.c b/engine-parser/src/tts-engine-parser.c old mode 100644 new mode 100755 index a9765a8..c5e2e27 --- a/engine-parser/src/tts-engine-parser.c +++ b/engine-parser/src/tts-engine-parser.c @@ -131,7 +131,9 @@ static int __remove_engine_info_xml(const char *pkgid) snprintf(path, 256, "%s/%s.xml", TTS_ENGINE_INFO, pkgid); if (0 == access(path, F_OK)) { LOGD("Remove engine info xml(%s)", path); - remove(path); + if (0 != remove(path)) { + LOGE("[ERROR] Fail to Remove engine info xml(%s)", path); + } } LOGD("==="); return 0; diff --git a/org.tizen.voice.ttsnotiserver.service b/org.tizen.voice.ttsnotiserver.service index 018f8ea..715d186 100644 --- a/org.tizen.voice.ttsnotiserver.service +++ b/org.tizen.voice.ttsnotiserver.service @@ -1,4 +1,4 @@ [D-BUS Service] Name=org.tizen.voice.ttsnotiserver -Exec=/bin/sh -c "voice_getengine get user db/voice/tts/engine/default | awk '{print$5}' | xargs -t -i launch_app {}-noti mode noti" +Exec=/bin/sh -c "voice_getengine get system db/voice/tts/engine/default | awk '{print$5}' | xargs -t -i launch_app {}-noti mode noti" #Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default-noti mode noti" diff --git a/org.tizen.voice.ttsserver.service b/org.tizen.voice.ttsserver.service index 432e4f9..4a92dde 100644 --- a/org.tizen.voice.ttsserver.service +++ b/org.tizen.voice.ttsserver.service @@ -1,4 +1,4 @@ [D-BUS Service] Name=org.tizen.voice.ttsserver -Exec=/bin/sh -c "voice_getengine get user db/voice/tts/engine/default | awk '{print$5}' | xargs -t -i launch_app {}" +Exec=/bin/sh -c "voice_getengine get system db/voice/tts/engine/default | awk '{print$5}' | xargs -t -i launch_app {}" #Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default" diff --git a/org.tizen.voice.ttssrserver.service b/org.tizen.voice.ttssrserver.service index 80b6f77..119f965 100644 --- a/org.tizen.voice.ttssrserver.service +++ b/org.tizen.voice.ttssrserver.service @@ -1,4 +1,4 @@ [D-BUS Service] Name=org.tizen.voice.ttssrserver -Exec=/bin/sh -c "voice_getengine get user db/voice/tts/engine/default | awk '{print$5}' | xargs -t -i launch_app {}-sr mode sr" +Exec=/bin/sh -c "voice_getengine get system db/voice/tts/engine/default | awk '{print$5}' | xargs -t -i launch_app {}-sr mode sr" #Exec=/bin/sh -c "launch_app org.tizen.tts-engine-default-sr mode sr" diff --git a/packaging/tts.spec b/packaging/tts.spec index 55c3130..11b4e91 100644 --- a/packaging/tts.spec +++ b/packaging/tts.spec @@ -99,8 +99,6 @@ mkdir -p %{_libdir}/voice mkdir -p %{TZ_SYS_RO_SHARE}/voice/test -# buxton2ctl create-string # -buxton2ctl create-string "user" "db/voice/tts/engine/default" "org.tizen.tts-engine-default" "http://tizen.org/privilege/internal/default/public" "http://tizen.org/privilege/internal/default/platform" %postun -p /sbin/ldconfig diff --git a/server/ttsd_server.c b/server/ttsd_server.c old mode 100644 new mode 100755 index 93fdbad..a65f2a5 --- a/server/ttsd_server.c +++ b/server/ttsd_server.c @@ -375,9 +375,6 @@ void __config_changed_cb(tts_config_type_e type, const char* str_param, int int_ } break; } - - default: - break; } return; diff --git a/test/test_main.c b/test/test_main.c old mode 100644 new mode 100755 index 428a356..1bcb001 --- a/test/test_main.c +++ b/test/test_main.c @@ -41,10 +41,14 @@ static bool __tts_test_get_text_from_file(const char* path, char** text) return 0; } - fseek(fp , 0 , SEEK_END); + if (0 != fseek(fp , 0 , SEEK_END)) { + SLOG(LOG_ERROR, tts_tag(), "Fail to fseek()"); + fclose(fp); + return 0; + } int text_len = ftell(fp); - if (0 >= text_len) { + if (0 >= text_len || 0 > text_len + 1) { SLOG(LOG_ERROR, tts_tag(), "File has no contents"); fclose(fp); return 0; @@ -53,7 +57,7 @@ static bool __tts_test_get_text_from_file(const char* path, char** text) rewind(fp); char* temp = NULL; - temp = (char*)calloc(1, text_len+1); + temp = (char*)calloc(1, text_len + 1); if (temp == NULL) { SLOG(LOG_ERROR, tts_tag(), "Fail to memory allocation");