[Bugfix][T106BUG-43][Data]fix the segmentation fault when call apn_xml_query
Change-Id: Ibc3473678ab70ed9e7b7ce748c6b2e7e48949853
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
old mode 100644
new mode 100755
index cfffa79..95d53b2
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
@@ -311,9 +311,23 @@
goto FAILED;
}
modify_node = node->xmlChildrenNode;
- modify_node = modify_node->next;
- for (node_num = 0;node_num<(int)profile_idx;node_num++)
+ if(modify_node != NULL)
{
+ modify_node = modify_node->next;
+ }
+ else
+ {
+ LYERRLOG("modify_node is null\n");
+ goto FAILED;
+ }
+ LYINFLOG("profile_idx is %d\n", (int)profile_idx);
+ for (node_num = 0;(node_num<(int)profile_idx);node_num++)
+ {
+ if(modify_node == NULL)
+ {
+ LYERRLOG("modify_node is null\n");
+ goto FAILED;
+ }
if (xmlGetProp(modify_node, "profile_idx") == NULL) //Null Node
{
modify_node = modify_node->next;