Fix issue detected by static analysis tool 66/279366/1 accepted/tizen/unified/20220809.213751 submit/tizen/20220808.061214
authorInHong Han <inhong1.han@samsung.com>
Mon, 8 Aug 2022 04:54:32 +0000 (13:54 +0900)
committerInHong Han <inhong1.han@samsung.com>
Mon, 8 Aug 2022 04:54:32 +0000 (13:54 +0900)
Change-Id: I3d296586e161a2a024b301c1ef21e2f406799109

src/service_main.cpp

index c670fdd..ceee5c6 100644 (file)
@@ -937,7 +937,7 @@ const char* CServiceMain::get_client_appid_by_wakeup_word(const char *wakeup_wor
                                0 < strlen(items[loop].appid)) {
                                for (int inner_loop = 0; inner_loop < MAX_WAKEUP_WORDS_NUM; inner_loop++) {
                                        if (0 < strlen(items[loop].wakeup_word[inner_loop])) {
-                                               char comparand[MAX_WAKEUP_WORD_LEN];
+                                               char comparand[MAX_WAKEUP_WORD_LEN] = {0, };
                                                int comparand_index = 0;
                                                for (int index = 0; index < MAX_WAKEUP_WORD_LEN; index++) {
                                                        if (' ' != items[loop].wakeup_word[inner_loop][index]) {
@@ -986,7 +986,7 @@ int CServiceMain::set_current_client_by_wakeup_word(const char *wakeup_word)
                                0 < strlen(items[loop].appid)) {
                                for (int inner_loop = 0; inner_loop < MAX_WAKEUP_WORDS_NUM; inner_loop++) {
                                        if (0 < strlen(items[loop].wakeup_word[inner_loop])) {
-                                               char comparand[MAX_WAKEUP_WORD_LEN];
+                                               char comparand[MAX_WAKEUP_WORD_LEN] = {0, };
                                                int comparand_index = 0;
                                                for (int index = 0; index < MAX_WAKEUP_WORD_LEN; index++) {
                                                        if (' ' != items[loop].wakeup_word[inner_loop][index]) {