Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
0d533d77ff
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  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();