From: Ji-hoon Lee Date: Wed, 10 Jul 2013 01:29:54 +0000 (+0900) Subject: Added code for checking the index of an array X-Git-Tag: accepted/tizen/generic/20140306.083317~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc9a7a66c4fbb01c0b88649515c5f76f22e6c7d5;p=platform%2Fcore%2Fuifw%2Flibscl-ui.git Added code for checking the index of an array Change-Id: I7a98d119b917f5634adf61fe2118a4641f10b3e3 --- diff --git a/packaging/libscl-ui.changes b/packaging/libscl-ui.changes new file mode 100644 index 0000000..e69de29 diff --git a/packaging/libscl-ui.spec b/packaging/libscl-ui.spec index 97e6b80..97e78da 100644 --- a/packaging/libscl-ui.spec +++ b/packaging/libscl-ui.spec @@ -3,7 +3,7 @@ Name: libscl-ui Summary: A library for developing XML-based software keyboards -Version: 0.3.7 +Version: 0.3.8 Release: 1 Group: TO BE / FILLED IN License: TO BE / FILLED IN diff --git a/scl/include/sclversion.h b/scl/include/sclversion.h index 0745469..7c2d3e3 100644 --- a/scl/include/sclversion.h +++ b/scl/include/sclversion.h @@ -18,7 +18,7 @@ #ifndef __SCL_VERSION_H__ #define __SCL_VERSION_H__ -#define SCL_VERSION "0.3.7-1" +#define SCL_VERSION "0.3.8-1" #endif //__SCL_VERSION_H diff --git a/xmlresource/nine_patch_file_list_parser.cpp b/xmlresource/nine_patch_file_list_parser.cpp index a2cdff9..42db7b3 100644 --- a/xmlresource/nine_patch_file_list_parser.cpp +++ b/xmlresource/nine_patch_file_list_parser.cpp @@ -67,18 +67,20 @@ class NinePatchFileListParserImpl { 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)); - get_prop_number(cur_node, "top", &(m_nine_patch_file_list[m_size].top)); - get_prop_number(cur_node, "bottom", &(m_nine_patch_file_list[m_size].bottom)); - if (m_nine_patch_file_list[m_size].image_path == NULL) { - SCLLOG(SclLog::ERROR, "NinePatchFileParser: image_path should be not NULL"); - } - m_size++; - if (m_size >= MAX_NINE_PATCH_FILE_LIST) { - SCLLOG(SclLog::ERROR, "No Space for nine patch file list record."); - break; + if (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)); + get_prop_number(cur_node, "top", &(m_nine_patch_file_list[m_size].top)); + get_prop_number(cur_node, "bottom", &(m_nine_patch_file_list[m_size].bottom)); + if (m_nine_patch_file_list[m_size].image_path == NULL) { + SCLLOG(SclLog::ERROR, "NinePatchFileParser: image_path should be not NULL"); + } + m_size++; + if (m_size >= MAX_NINE_PATCH_FILE_LIST) { + SCLLOG(SclLog::ERROR, "No Space for nine patch file list record."); + break; + } } }