Explorar o código

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 %!s(int64=9) %!d(string=hai) anos
pai
achega
0d533d77ff
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  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();