浏览代码

Merge pull request #13226 from ghalliday/issue23223b

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

Reviewed-By: Jake Smith <jake.smith@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 5 年之前
父节点
当前提交
b6984ed745
共有 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());
     }