From: sungwook79.park Date: Mon, 31 Jul 2017 06:46:01 +0000 (+0900) Subject: Fix issue that detected by static analysis tool X-Git-Tag: accepted/tizen/3.0/common/20170801.163338~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Finputdelegator.git;a=commitdiff_plain;h=527ea1f8258023829ef718ba1e8835daf3f188e1 Fix issue that detected by static analysis tool Change-Id: I4b6698fff33df9a627943ec0c9e8315adadacaf6 Signed-off-by: sungwook79.park --- diff --git a/inc/w-input-stt-voice.h b/inc/w-input-stt-voice.h index 435b4f9..685f252 100755 --- a/inc/w-input-stt-voice.h +++ b/inc/w-input-stt-voice.h @@ -76,6 +76,7 @@ #define EVAS_CANDIDATE_LAYER 32000 +int init_voicedata(VoiceData *r_voicedata); int init_voice(Evas_Object *parent, const char *lang, VoiceData *r_voicedata); int is_lang_supported_by_stt(char lang[]); Evas_Object *show_voice_window(Evas_Object *parent, VoiceData *voicedata); diff --git a/src/w-input-stt-ise.cpp b/src/w-input-stt-ise.cpp index 965d36d..7f40e69 100755 --- a/src/w-input-stt-ise.cpp +++ b/src/w-input-stt-ise.cpp @@ -48,7 +48,7 @@ void show_voice_input(Evas_Object *parent, const char *lang, void (*get_string)( PRINTFUNC(DLOG_ERROR, "%d::::Heap Overflow, Voice Input cannot be shown!", __LINE__); return; } - memset(my_voicedata, 0, sizeof(VoiceData)); + init_voicedata(my_voicedata); } if (my_voicedata) { diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 17524fa..2c2c23c 100755 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -1743,6 +1743,44 @@ int is_lang_supported_by_stt(char lang[]) return FALSE; } +int init_voicedata(VoiceData *r_voicedata) +{ + VoiceData *voicedata = (VoiceData *)r_voicedata; + if (!voicedata) { + return FALSE; + } + + voicedata->voicefw_state = 0; + voicedata->voicefw_handle = NULL; + voicedata->naviframe = NULL; + voicedata->layout_main = NULL; + voicedata->progressbar = NULL; + voicedata->scroller = NULL; + voicedata->main_entry = NULL; + voicedata->mic_button = NULL; + voicedata->state = STT_STATE_VAL_INIT; + voicedata->kbd_lang = NULL; + voicedata->start_timer = NULL; + voicedata->refresh_timer = NULL; + voicedata->progressbar_timer = NULL; + voicedata->textblock_timer = NULL; + voicedata->guide_text_timer = NULL; + voicedata->btn_disabling_timer = NULL; + voicedata->power_unlock_timer = NULL; + + voicedata->stt_results.clear(); + voicedata->partial_result = NULL; + voicedata->result_type = 0; + voicedata->disclaimer = 0; + voicedata->mo = NULL; + voicedata->sttfeedback = NULL; + voicedata->sttmanager = NULL; + voicedata->ieffect = NULL; + voicedata->effector = NULL; + + return TRUE; +} + int init_voice(Evas_Object *parent, const char *lang, VoiceData *r_voicedata) { PRINTFUNC(DLOG_DEBUG, "[init_voice]");