[support #1681507] HX49169: GreenGUI crashes after traffic start, not possible to control traffic anymore / László Dénes

Change-Id: I98199e3fa8dfda31e6eeeb7604ae4bab4e335f6e
Signed-off-by: József Gyürüsi <jozsef.gyurusi@ericsson.com>
diff --git a/src/DsRestAPI/EPTF_CLL_DsRestAPI_DSServer_Functions.ttcn b/src/DsRestAPI/EPTF_CLL_DsRestAPI_DSServer_Functions.ttcn
index d89bb25..f1d6529 100644
--- a/src/DsRestAPI/EPTF_CLL_DsRestAPI_DSServer_Functions.ttcn
+++ b/src/DsRestAPI/EPTF_CLL_DsRestAPI_DSServer_Functions.ttcn
@@ -736,19 +736,21 @@
         f_EPTF_FBQ_moveFromBusyToFreeTail(pl_transactionid, v_DsRestAPI_DSServer_responseQueue);
       } else {
         // else we insert the response and send its child requests if we do not filter it
-        var EPTF_DsRestAPI_Request vl_request := pl_requests[pl_responseData.path[pl_nextPathIndex]];
-        if (ischosen(vl_request.getData) and ispresent(vl_request.getData.filter) and pl_responseData.checkPostFilter and not ispresent(vl_request.getData.selectionValues) and (ischosen(pl_contentToInsert.node) or (ischosen(pl_contentToInsert.list) and sizeof(pl_contentToInsert.list) > 0))) {
-          f_EPTF_DsRestAPI_DSServer_sendPostFilter(pl_transactionid, pl_errorCode, pl_responseData.parentList, pl_responseData.parentIndexList, pl_contentToInsert, vl_request.getData.filter);
-        } else {
-          pl_contentList[pl_responseData.path[pl_nextPathIndex]] := pl_contentToInsert;
-          f_EPTF_FBQ_moveFromBusyToFreeTail(pl_transactionid, v_DsRestAPI_DSServer_responseQueue);
-          // TODO cookie can be inserted here
-          if (ischosen(pl_contentToInsert.list) or pl_contentToInsert.node.tp != 0) {
-            if (ischosen(vl_request.getData) and ispresent(vl_request.getData.writableInfo)) {
-              f_EPTF_DsRestAPI_DSServer_sendIsWriteableRequest(pl_responseData.requestId, vl_request, pl_responseData.parentList, pl_responseData.parentIndexList, pl_responseData.path, pl_responseData.indexesInList);
-            }
-            if (ischosen(vl_request.getData) and ispresent(vl_request.getData.children) and pl_errorCode == 0) {
-              f_EPTF_DsRestAPI_DSServer_prepareAndSendChildRequests(pl_responseData.requestId, vl_request, pl_contentToInsert, pl_responseData.parentList, pl_responseData.parentIndexList, pl_responseData.path, pl_responseData.indexesInList);
+        if (pl_responseData.path[pl_nextPathIndex] < sizeof(pl_requests)) {
+          var EPTF_DsRestAPI_Request vl_request := pl_requests[pl_responseData.path[pl_nextPathIndex]];
+          if (ischosen(vl_request.getData) and ispresent(vl_request.getData.filter) and pl_responseData.checkPostFilter and not ispresent(vl_request.getData.selectionValues) and (ischosen(pl_contentToInsert.node) or (ischosen(pl_contentToInsert.list) and sizeof(pl_contentToInsert.list) > 0))) {
+            f_EPTF_DsRestAPI_DSServer_sendPostFilter(pl_transactionid, pl_errorCode, pl_responseData.parentList, pl_responseData.parentIndexList, pl_contentToInsert, vl_request.getData.filter);
+          } else {
+            pl_contentList[pl_responseData.path[pl_nextPathIndex]] := pl_contentToInsert;
+            f_EPTF_FBQ_moveFromBusyToFreeTail(pl_transactionid, v_DsRestAPI_DSServer_responseQueue);
+            // TODO cookie can be inserted here
+            if (ischosen(pl_contentToInsert.list) or pl_contentToInsert.node.tp != 0) {
+              if (ischosen(vl_request.getData) and ispresent(vl_request.getData.writableInfo)) {
+                f_EPTF_DsRestAPI_DSServer_sendIsWriteableRequest(pl_responseData.requestId, vl_request, pl_responseData.parentList, pl_responseData.parentIndexList, pl_responseData.path, pl_responseData.indexesInList);
+              }
+              if (ischosen(vl_request.getData) and ispresent(vl_request.getData.children) and pl_errorCode == 0) {
+                f_EPTF_DsRestAPI_DSServer_prepareAndSendChildRequests(pl_responseData.requestId, vl_request, pl_contentToInsert, pl_responseData.parentList, pl_responseData.parentIndexList, pl_responseData.path, pl_responseData.indexesInList);
+              }
             }
           }
         }