瀏覽代碼

HPCC-9782 Fix ESP core when package set not found from dali

When package set is not found from dali, getPkgSetRegistry()
returns a NULL pointer. ESP PackageProcesses service should
check the pointer before using it.

Signed-off-by: Kevin Wang <kevin.wang@lexisnexis.com>
Kevin Wang 12 年之前
父節點
當前提交
d2e7ec38c8
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      esp/services/ws_packageprocess/ws_packageprocessService.cpp

+ 3 - 0
esp/services/ws_packageprocess/ws_packageprocessService.cpp

@@ -337,6 +337,9 @@ void getPkgInfo(const char *target, const char *process, StringBuffer &info)
     IPropertyTree *root = globalLock->queryRoot();
     Owned<IPropertyTree> tree = createPTree("PackageMaps");
     Owned<IPropertyTree> pkgSetRegistry = getPkgSetRegistry((process && *process) ? process : "*", NULL, true);
+    if (!pkgSetRegistry)
+        throw MakeStringException(PKG_DALI_LOOKUP_ERROR, "Unable to retrieve package information from dali for process %s", (process && *process) ? process : "*");
+
     StringBuffer xpath("PackageMap[@active='1']");
     if (target && *target)
         xpath.appendf("[@querySet='%s']", target);