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>
@@ -406,7 +406,7 @@ public:
}
virtual const char * queryScope() const
{
- return scope;
+ return scope ? scope : "";
virtual IStringVal & getFormattedValue(IStringVal & str) const
@@ -735,6 +735,7 @@ public:
extra.getCreator(creator);
StatisticScopeType scopeType = extra.getScopeType();
const char * scope = extra.queryScope();
+ if (!scope) scope = "";
extra.getDescription(description, true);
StatisticMeasure measure = extra.getMeasure();
@@ -122,16 +122,16 @@ MODULE_INIT(INIT_PRIORITY_STANDARD)
extern jlib_decl int compareScopeName(const char * left, const char * right)
- if (!*left)
+ if (!left || !*left)
- if (!*right)
+ if (!right || !*right)
return 0;
else
return -1;
return +1;