소스 검색

HPCC-19852 Check pointer expandedClusterGroup before using it

An unbound thor cluster causes esp to segfault when user clicks on
an ECLWatch link for more details. The segfault is due to invalid
expandedClusterGroup pointer returned by getGroupFromCluster().
This fix checks the pointer. If invalid, an exception will be
thrown.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
wangkx 7 년 전
부모
커밋
dd8ab97163
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      dali/base/dadfs.cpp

+ 2 - 0
dali/base/dadfs.cpp

@@ -9762,6 +9762,8 @@ static IGroup *getClusterNodeGroup(const char *clusterName, const char *type, bo
     Owned<IGroup> nodeGroup = queryNamedGroupStore().lookup(nodeGroupName);
     CInitGroups init(timems);
     Owned<IGroup> expandedClusterGroup = init.getGroupFromCluster(type, cluster, true);
+    if (!expandedClusterGroup)
+        throwStringExceptionV(0, "Failed to get group for '%s' cluster '%s'", type, clusterName);
     if (!expandedClusterGroup->equals(nodeGroup))
         throwStringExceptionV(0, "DFS cluster topology for '%s', does not match existing DFS group layout for group '%s'", clusterName, nodeGroupName.str());
     Owned<IGroup> clusterGroup = init.getGroupFromCluster(type, cluster, false);