瀏覽代碼

HPCC-23223 Protect statistic iterator from old workunits with null scopes

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 5 年之前
父節點
當前提交
095370d7a8
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 2 1
      common/workunit/workunit.cpp
  2. 1 1
      dali/daliadmin/daliadmin.cpp

+ 2 - 1
common/workunit/workunit.cpp

@@ -1100,7 +1100,8 @@ public:
 
     virtual const char * queryScope() const  override
     {
-        return notes.item(baseIndex).queryScope();
+        const char * scope = notes.item(baseIndex).queryScope();
+        return scope ? scope : "";
     }
 
     virtual StatisticScopeType getScopeType() const override

+ 1 - 1
dali/daliadmin/daliadmin.cpp

@@ -2709,7 +2709,7 @@ public:
 
         xml.appendf("<attr source='%s' message='%s' timestamp='%s' exceptionCode='%u' severity='%u' scope='%s' cost='%u'",
                     source.str(), message.str(), timestamp.str(),
-                    exception.getExceptionCode(), exception.getSeverity(), exception.queryScope(), exception.getPriority());
+                    exception.getExceptionCode(), exception.getSeverity(), nullText(exception.queryScope()), exception.getPriority());
         xml.append("/>");
         printf(" %s\n", xml.str());
     }