[Bugfix][T106BUG-129]fix add apn can over QSER_APN_MAX_LIST

Only Configure: No
Affected branch: master
Affected module: data
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: Ia27ff846c66dd9fa473be9697a967444ba029068
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
index 8cb0da3..f017ef6 100755
--- 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
@@ -141,9 +141,14 @@
         node_num++;
         sum_node = sum_node->next;
     }
+    LYINFLOG("apn_num = %d ",node_num);
+    if(node_num >= QSER_APN_MAX_LIST)
+    {
+        LYERRLOG("apn num reached the max");
+        goto FAILED;
+    }
     tmp_node = xmlNewNode(NULL,BAD_CAST"apn");
     *apn_num = node_num;
-    LYERRLOG("apn_num%d ",node_num);
     bzero(temp_buff,12);
     snprintf(temp_buff,sizeof(temp_buff),"%d",*apn_num);
     xmlNewProp(tmp_node,BAD_CAST"profile_idx",(xmlChar *)temp_buff);
@@ -873,4 +878,4 @@
         return ret;
     }
     return ret;
-}
\ No newline at end of file
+}