Sfoglia il codice sorgente

HPCC-14104 Check getWorkflowItems() return before using

The 6.0 ESP crashes when running ecl in ECLPLayground.
It happens when ECLPlayground calls WsWorkunits.WUINfo.
The getWorkflowItems() returns NULL when it is called in
WUInfo. WUINfo should check the return before using it.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
wangkx 9 anni fa
parent
commit
0d533d77ff
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      esp/services/ws_workunits/ws_workunitsHelpers.cpp

+ 4 - 1
esp/services/ws_workunits/ws_workunitsHelpers.cpp

@@ -1257,8 +1257,11 @@ void WsWuInfo::getWorkflow(IEspECLWorkunit &info, unsigned flags)
         return;
     try
     {
-        IArrayOf<IConstECLWorkflow> workflows;
         Owned<IConstWorkflowItemIterator> it = cw->getWorkflowItems();
+        if (!it)
+            return;
+
+        IArrayOf<IConstECLWorkflow> workflows;
         ForEach(*it)
         {
             IConstWorkflowItem* r = it->query();