Quellcode durchsuchen

HPCC-23136 Fix uninitialized request value causing serialization error

Fix uninitialized value in client side use of WULogFileRequest causing
exception in serialization.

Also fix infinite loop in processing of WULogFileResponse exceptions
in "eclplus dump" command.

Signed-off-by: Anthony Fishbeck <anthony.fishbeck@lexisnexisrisk.com>
Anthony Fishbeck vor 5 Jahren
Ursprung
Commit
ce6ad8ad5f
2 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
  1. 2 2
      ecl/eclplus/DumpHelper.cpp
  2. 1 0
      esp/services/ws_workunits/ws_workunitsQuerySets.cpp

+ 2 - 2
ecl/eclplus/DumpHelper.cpp

@@ -21,8 +21,7 @@ static bool processExceptions(const IMultiException* excep)
 {
 {
     if (excep && excep->ordinality())
     if (excep && excep->ordinality())
     {
     {
-        unsigned i = 0;
-        while (i < excep->ordinality())
+        ForEachItemIn(i, *excep)
         {
         {
             StringBuffer msg;
             StringBuffer msg;
             excep->item(i).errorMessage(msg);
             excep->item(i).errorMessage(msg);
@@ -80,6 +79,7 @@ bool DumpHelper::doit(FILE * fp)
             Owned<IClientWULogFileRequest> req = wuclient->createWUFileRequest();
             Owned<IClientWULogFileRequest> req = wuclient->createWUFileRequest();
             req->setWuid(wuid);
             req->setWuid(wuid);
             req->setType("XML");
             req->setType("XML");
+            req->setErrorMessageFormat(CErrorMessageFormat_XML);
             Owned<IClientWULogFileResponse> resp = wuclient->WUFile(req);
             Owned<IClientWULogFileResponse> resp = wuclient->WUFile(req);
             if(!resp)
             if(!resp)
             {
             {

+ 1 - 0
esp/services/ws_workunits/ws_workunitsQuerySets.cpp

@@ -124,6 +124,7 @@ void fetchRemoteWorkunit(IClientWsWorkunits *_ws, IEspContext *ctx, const char *
         req->setQuery(query);
         req->setQuery(query);
     if (wuid && *wuid)
     if (wuid && *wuid)
         req->setWuid(wuid);
         req->setWuid(wuid);
+    req->setErrorMessageFormat(CErrorMessageFormat_XML);
     req->setType("xml");
     req->setType("xml");
     Owned<IClientWULogFileResponse> resp = ws->WUFile(req);
     Owned<IClientWULogFileResponse> resp = ws->WUFile(req);
     if (!resp || resp->getExceptions().ordinality() || !resp->getThefile().length())
     if (!resp || resp->getExceptions().ordinality() || !resp->getThefile().length())