fix prevent issue
authoryanjie.hu <yanjie.hu@samsung.com>
Thu, 2 May 2013 05:33:42 +0000 (13:33 +0800)
committeryanjie.hu <yanjie.hu@samsung.com>
Thu, 2 May 2013 05:39:23 +0000 (13:39 +0800)
Change-Id: Ib3bbb78dd3e4bfc87b08564fca58891cd8996308

xmlresource/modifier_decoration_parser.cpp
xmlresource/nine_patch_file_list_parser.cpp

index ddd9af8..dba8b58 100644 (file)
@@ -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) {
index 40ea94d..f0e5f39 100644 (file)
@@ -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;
                     }
                 }