From: Ji-hoon Lee Date: Tue, 14 Apr 2020 04:57:28 +0000 (+0900) Subject: Fix defects detected by static analysis tool X-Git-Tag: accepted/tizen/unified/20200414.135745~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c8606b56e612839a025c667b9420aac877ddef1;p=platform%2Fcore%2Fuifw%2Fmulti-assistant-service.git Fix defects detected by static analysis tool Change-Id: Iae05d46900fa3d2a757c0ae914195f7d5855504d --- diff --git a/src/service_config.cpp b/src/service_config.cpp index a86b491..223c27b 100644 --- a/src/service_config.cpp +++ b/src/service_config.cpp @@ -333,7 +333,7 @@ int CServiceConfig::load_custom_wake_words(const char* app_id, *language_end = '\0'; if (0 == strlen(word_start)) break; strncpy(wakeup_word_storage[index], word_start, MAX_WAKEUP_WORD_LEN - 1); - strncpy(wakeup_language_storage[index], language_start, MAX_WAKEUP_WORD_LEN - 1); + strncpy(wakeup_language_storage[index], language_start, MAX_SUPPORTED_LANGUAGE_LEN - 1); word_start = word_end + 1; language_start = language_end + 1; LOGD("Added custom wakeup word : (%s) (%s)", diff --git a/src/service_ipc_dbus_dispatcher.cpp b/src/service_ipc_dbus_dispatcher.cpp index 26e7ac1..e6e74a3 100644 --- a/src/service_ipc_dbus_dispatcher.cpp +++ b/src/service_ipc_dbus_dispatcher.cpp @@ -821,6 +821,7 @@ int CServiceIpcDbusDispatcher::on_remove_wake_word(DBusConnection* conn, DBusMes { if (nullptr == mIpcObserver) { MAS_LOGE("mIpcObserver variable is NULL"); + return -1; } DBusError err; @@ -1025,4 +1026,4 @@ int CServiceIpcDbusDispatcher::on_ui_change_assistant(DBusConnection* conn, DBus MAS_LOGD(" "); return ret; -} \ No newline at end of file +}