From: InHong Han Date: Tue, 28 Jun 2022 02:49:50 +0000 (+0900) Subject: Fix unsafe code for security X-Git-Tag: submit/tizen/20220628.044215~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=040fae671fa292ec5f5f23d6e07bac1c2a58c099;p=platform%2Fcore%2Fuifw%2Fmulti-assistant.git Fix unsafe code for security Change-Id: If703ccf00bd8da35867c5f00bfd3e0ab0c1fde0b --- diff --git a/assistant-parser/src/ma_assistant_parser.c b/assistant-parser/src/ma_assistant_parser.c index dc3971c..b9a7ab4 100644 --- a/assistant-parser/src/ma_assistant_parser.c +++ b/assistant-parser/src/ma_assistant_parser.c @@ -326,6 +326,11 @@ static void __insert_language_from_metadata(xmlNodePtr root, const char *languag xmlNodePtr languages_node = NULL; xmlNodePtr lang_node = NULL; + if (tmp_lang == NULL) { + LOGE("[ERROR] Fail to allocate memory"); + return; + } + languages_node = xmlNewNode(NULL, (const xmlChar*)MA_TAG_ASSISTANT_LANGUAGE_SET); if (languages_node) { lang = strsep(&tmp_lang, ","); @@ -401,6 +406,11 @@ static void __insert_wakeup_engine_from_metadata(xmlNodePtr root, const char *wa xmlNodePtr wakeup_engines_node = NULL; xmlNodePtr wakeup_engine_node = NULL; + if (tmp_wakeup_engine == NULL) { + LOGE("[ERROR] Fail to allocate memory"); + return; + } + char* engine = NULL; wakeup_engines_node = xmlNewNode(NULL, (const xmlChar*)MA_TAG_ASSISTANT_WAKEUP_ENGINE_SET); if (wakeup_engines_node) {