From: yanjie.hu Date: Thu, 2 May 2013 05:33:42 +0000 (+0800) Subject: fix prevent issue X-Git-Tag: submit/tizen_2.1/20130514.053055~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49fdc0cb1d42f7937a8706f6b92d48ae4238b14f;p=framework%2Fuifw%2Flibscl-ui.git fix prevent issue Change-Id: Ib3bbb78dd3e4bfc87b08564fca58891cd8996308 --- diff --git a/xmlresource/modifier_decoration_parser.cpp b/xmlresource/modifier_decoration_parser.cpp index ddd9af8..dba8b58 100644 --- a/xmlresource/modifier_decoration_parser.cpp +++ b/xmlresource/modifier_decoration_parser.cpp @@ -140,7 +140,7 @@ class ModifierDecorationParserImpl { int size = 0; while (cur_node != NULL) { if (0 == xmlStrcmp(cur_node->name, (const xmlChar *)"modifier_decoration_record")) { - parsing_modifier_decoration_record( cur_node, cur_rec); + parsing_modifier_decoration_record(cur_node, cur_rec); size++; cur_rec++; if (size >= MAX_SCL_MODIFIER_DECORATION_NUM) { diff --git a/xmlresource/nine_patch_file_list_parser.cpp b/xmlresource/nine_patch_file_list_parser.cpp index 40ea94d..f0e5f39 100644 --- a/xmlresource/nine_patch_file_list_parser.cpp +++ b/xmlresource/nine_patch_file_list_parser.cpp @@ -66,6 +66,7 @@ class NinePatchFileListParserImpl { assert(m_size == 0); while (cur_node != NULL) { if (0 == xmlStrcmp(cur_node->name, (const xmlChar *)"file")) { + assert(m_size >= 0 && m_size < MAX_NINE_PATCH_FILE_LIST); m_nine_patch_file_list[m_size].image_path = (const char*)xmlNodeGetContent(cur_node); get_prop_number(cur_node, "left", &(m_nine_patch_file_list[m_size].left)); get_prop_number(cur_node, "right", &(m_nine_patch_file_list[m_size].right)); @@ -77,6 +78,7 @@ class NinePatchFileListParserImpl { m_size++; if (m_size >= MAX_NINE_PATCH_FILE_LIST) { SCLLOG(SclLog::ERROR, "No Space for nine patch file list record."); + break; } }