Przeglądaj źródła

Issue #135 - More fixes to -Wformat errors

Introduce more checkes on vararg type functions in thor
Clearup all 'warning: format not a string literal and no format arguments'

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>
Jake Smith 14 lat temu
rodzic
commit
814d62dc09
86 zmienionych plików z 302 dodań i 306 usunięć
  1. 2 2
      common/roxiecommlib/roxiecommunicationclient.cpp
  2. 2 2
      common/thorhelper/thorrparse.cpp
  3. 4 4
      common/thorhelper/thorsoapcall.cpp
  4. 1 1
      common/thorhelper/thorxmlread.cpp
  5. 4 13
      dali/base/dacsds.cpp
  6. 2 2
      dali/base/dadfs.cpp
  7. 1 2
      dali/base/dadiags.cpp
  8. 15 15
      dali/base/dasds.cpp
  9. 1 1
      dali/base/dasds.ipp
  10. 3 3
      dali/dfu/dfurunkdp.cpp
  11. 1 1
      dali/dfu/dfuwu.cpp
  12. 1 1
      dali/dfuXRefLib/dfuxreflib.cpp
  13. 3 3
      dali/ft/filecopy.cpp
  14. 1 1
      deployment/deploy/DeploymentEngine.cpp
  15. 2 2
      deployment/deployutils/configenvhelper.cpp
  16. 1 1
      deployment/deployutils/deployutils.cpp
  17. 4 4
      ecl/eclagent/eclagent.cpp
  18. 3 3
      ecl/eclagent/eclgraph.cpp
  19. 2 2
      ecl/hql/hqlesp.cpp
  20. 1 1
      ecl/hql/hqlexpr.cpp
  21. 1 1
      ecl/hql/hqlscope.cpp
  22. 1 1
      ecl/hqlcpp/hqlcpp.cpp
  23. 1 1
      ecl/hqlcpp/hqlhtcpp.cpp
  24. 2 2
      ecl/hqlcpp/hqliproj.cpp
  25. 2 2
      ecl/hqlcpp/hqlresource.cpp
  26. 3 3
      ecl/hqlcpp/hqlttcpp.cpp
  27. 5 5
      ecl/hthor/hthor.cpp
  28. 1 1
      ecl/hthor/hthor.ipp
  29. 3 3
      ecl/hthor/hthorkey.cpp
  30. 2 2
      esp/bindings/SOAP/Platform/soapbind.cpp
  31. 2 2
      esp/bindings/SOAP/client/soapclient.cpp
  32. 5 5
      esp/bindings/http/client/httpclient.cpp
  33. 1 1
      esp/bindings/http/platform/httpbinding.cpp
  34. 1 1
      esp/bindings/http/platform/httpservice.cpp
  35. 1 1
      esp/services/WsDeploy/WsDeployEngine.cpp
  36. 8 8
      esp/services/WsDeploy/WsDeployService.cpp
  37. 1 1
      esp/services/ws_dfu/ws_dfuService.cpp
  38. 1 1
      esp/services/ws_fs/ws_fsService.cpp
  39. 1 1
      esp/services/ws_machine/ws_machineService.cpp
  40. 18 18
      esp/services/ws_workunits/ws_workunitsService.cpp
  41. 3 3
      esp/smc/SMCLib/LogicFileWrapper.cpp
  42. 3 3
      esp/smc/SMCLib/LogicFileWrapper.hpp
  43. 37 37
      esp/smc/SMCLib/TpWrapper.cpp
  44. 9 9
      esp/smc/SMCLib/WUXMLInfo.cpp
  45. 1 1
      esp/smc/SMCLib/exception_util.hpp
  46. 8 8
      plugins/fileservices/fileservices.cpp
  47. 2 2
      roxie/ccd/ccdfile.cpp
  48. 1 1
      roxie/ccd/ccdmain.cpp
  49. 1 1
      roxie/ccd/ccdquery.cpp
  50. 5 5
      roxie/ccd/ccdserver.cpp
  51. 3 3
      system/jhtree/jhtree.cpp
  52. 2 2
      system/jlib/jbroadcast.cpp
  53. 4 4
      system/jlib/jexcept.cpp
  54. 2 2
      system/jlib/jfile.cpp
  55. 2 2
      system/jlib/jlog.cpp
  56. 2 2
      system/jlib/jmisc.cpp
  57. 2 2
      system/security/LdapSecurity/ldapconnection.cpp
  58. 2 4
      system/security/securesocket/securesocket.cpp
  59. 20 20
      system/xmllib/xslprocessor.cpp
  60. 4 4
      system/xmllib/xslprocessor.ipp
  61. 1 1
      thorlcr/activities/choosesets/thchoosesetsslave.cpp
  62. 2 2
      thorlcr/activities/diskread/thdiskreadslave.cpp
  63. 2 2
      thorlcr/activities/hashdistrib/thhashdistribslave.cpp
  64. 1 1
      thorlcr/activities/lookupjoin/thlookupjoinslave.cpp
  65. 2 2
      thorlcr/activities/msort/thgroupsortslave.cpp
  66. 3 3
      thorlcr/activities/thactivityutil.cpp
  67. 1 1
      thorlcr/activities/topn/thtopnslave.cpp
  68. 1 1
      thorlcr/activities/wuidwrite/thwuidwrite.cpp
  69. 2 2
      thorlcr/activities/xmlparse/thxmlparseslave.cpp
  70. 2 2
      thorlcr/activities/xmlread/thxmlreadslave.cpp
  71. 3 3
      thorlcr/graph/thgraph.cpp
  72. 6 6
      thorlcr/graph/thgraph.hpp
  73. 3 3
      thorlcr/graph/thgraphmaster.cpp
  74. 5 5
      thorlcr/graph/thgraphslave.cpp
  75. 2 2
      thorlcr/master/thgraphmanager.cpp
  76. 2 2
      thorlcr/msort/tsortm.cpp
  77. 1 1
      thorlcr/msort/tsortmp.cpp
  78. 1 1
      thorlcr/msort/tsorts.cpp
  79. 1 1
      thorlcr/slave/backup.cpp
  80. 2 2
      thorlcr/slave/slave.cpp
  81. 2 2
      thorlcr/slave/slwatchdog.cpp
  82. 1 1
      thorlcr/slave/thslavemain.cpp
  83. 25 17
      thorlcr/thorutil/thormisc.hpp
  84. 1 1
      tools/backupnode/backupnode.cpp
  85. 1 1
      tools/hidl/hidlcomp.cpp
  86. 2 2
      tools/swapnode/swapnode.cpp

+ 2 - 2
common/roxiecommlib/roxiecommunicationclient.cpp

@@ -124,7 +124,7 @@ protected:
             if (!exception && sendlen > 11 && memicmp(block, "<Exception>", 11) == 0)
             {
                 Owned<IPropertyTree> eTree = createPTreeFromXMLString(sendlen, block, ipt_caseInsensitive);
-                exception.setown(MakeStringException(eTree->getPropInt("Code", 0), eTree->queryProp("Message")));
+                exception.setown(MakeStringException(eTree->getPropInt("Code", 0), "%s", eTree->queryProp("Message")));
             }
         }
         if (exception)
@@ -184,7 +184,7 @@ protected:
             else
                 ep.getUrlStr(buf);
 
-            throw MakeStringException(ROXIECOMM_SOCKET_ERROR, buf.str());
+            throw MakeStringException(ROXIECOMM_SOCKET_ERROR, "%s", buf.str());
         }
         return s;
     }

+ 2 - 2
common/thorhelper/thorrparse.cpp

@@ -486,10 +486,10 @@ RegexMatchAction RegexPattern::traceMatch(RegexState & state)
     if (len > 10) len = 10;
     getTraceText(t);
     s.appendN(i++, ' ').appendf("Begin %s [%p] >%.*s<", t.str(), this, len, state.cur);
-    DBGLOG(s);
+    DBGLOG("%s", s.str());
     RegexMatchAction ret = match(state);
     s.clear().appendN(--i, ' ').appendf("End   %s [%p] = %s", t.str(), this, resultText[ret]);
-    DBGLOG(s);
+    DBGLOG("%s", s.str());
     return ret;
 }
 

+ 4 - 4
common/thorhelper/thorsoapcall.cpp

@@ -99,7 +99,7 @@ public:
         e->errorMessage(text);
         rtlAddExceptionTag(text, "url", getUrlString(url).str());
         if (text.length() <= 1024)
-            return MakeStringException(e->errorCode(), text.str());
+            return MakeStringException(e->errorCode(), "%s", text.str());
         else
             return MakeStringExceptionDirect(e->errorCode(), text.str());
     }
@@ -272,7 +272,7 @@ private:
             catch (IException *e)
             {
                 StringBuffer s;
-                throw MakeStringException(ROXIE_ABORT_EVENT, e->errorMessage(s).str());
+                throw MakeStringException(ROXIE_ABORT_EVENT, "%s", e->errorMessage(s).str());
             }
         }
     }
@@ -1338,7 +1338,7 @@ private:
             catch (IException *e)
             {
                 StringBuffer s;
-                throw MakeStringException(ROXIE_ABORT_EVENT, e->errorMessage(s).str());
+                throw MakeStringException(ROXIE_ABORT_EVENT, "%s", e->errorMessage(s).str());
             }
         }
     }
@@ -1731,7 +1731,7 @@ public:
                                 err.append("Failure to establish secure connection to ");
                                 connUrl.getUrlString(err);
                                 err.append(": returned ").append(status);
-                                throw MakeStringException(0, err.str());
+                                throw MakeStringException(0, "%s", err.str());
                             }
                             socket.setown(ssock.getLink());
                         }

+ 1 - 1
common/thorhelper/thorxmlread.cpp

@@ -1210,7 +1210,7 @@ class CColumnProvider : public CInterface, implements IColumnProvider
             else
                 appendDataAsHex(errMsg, length, data);
             errMsg.append("'");
-            throw MakeStringException(0, errMsg.str());
+            throw MakeStringException(0, "%s", errMsg.str());
         } else if (length > rl)
             mb.setLength(rl);
     }

+ 4 - 13
dali/base/dacsds.cpp

@@ -1534,10 +1534,7 @@ IRemoteConnections *CClientSDSManager::connect(IMultipleConnector *mConnect, Ses
         throw MakeSDSException(SDSExcpt_VersionMismatch, "Multiple connect not supported by server versions prior to "MIN_MCONNECT_SVER);
 
     if (0 == id || id != myProcessSession())
-    {
-        StringBuffer s(", in multi connect");
-        throw MakeSDSException(SDSExcpt_InvalidSessionId, s.append(", sessionid=").appendf("%"I64F"x", id).str());
-    }
+        throw MakeSDSException(SDSExcpt_InvalidSessionId, ", in multi connect, sessionid=%"I64F"x", id);
 
     CMessageBuffer mb;
     mb.append((unsigned)DAMP_SDSCMD_MCONNECT | lazyExtFlag);
@@ -1548,7 +1545,7 @@ IRemoteConnections *CClientSDSManager::connect(IMultipleConnector *mConnect, Ses
     {
         StringBuffer s(", making multiple connect to ");
         getMConnectString(mConnect, s);
-        throw MakeSDSException(SDSExcpt_FailedToCommunicateWithServer, s.str());
+        throw MakeSDSException(SDSExcpt_FailedToCommunicateWithServer, "%s", s.str());
     }
 
     SdsReply replyMsg;
@@ -1593,10 +1590,7 @@ IRemoteConnections *CClientSDSManager::connect(IMultipleConnector *mConnect, Ses
 IRemoteConnection *CClientSDSManager::connect(const char *xpath, SessionId id, unsigned mode, unsigned timeout)
 {
     if (0 == id || id != myProcessSession())
-    {
-        StringBuffer s(", connecting to ");
-        throw MakeSDSException(SDSExcpt_InvalidSessionId, s.append(xpath).append(", sessionid=").appendf("%"I64F"x", id).str());
-    }
+        throw MakeSDSException(SDSExcpt_InvalidSessionId, ", connecting to %s, sessionid=%"I64F"x", xpath, id);
 
     CMessageBuffer mb;
     mb.append((int)DAMP_SDSCMD_CONNECT | lazyExtFlag);
@@ -1604,10 +1598,7 @@ IRemoteConnection *CClientSDSManager::connect(const char *xpath, SessionId id, u
     mb.append(xpath);
 
     if (!sendRequest(mb, true))
-    {
-        StringBuffer s(", connecting to ");
-        throw MakeSDSException(SDSExcpt_FailedToCommunicateWithServer, s.append(xpath).str());
-    }
+        throw MakeSDSException(SDSExcpt_FailedToCommunicateWithServer, ", connecting to %s", xpath);
 
     SdsReply replyMsg;
     

+ 2 - 2
dali/base/dadfs.cpp

@@ -5681,8 +5681,8 @@ StringBuffer & CDistributedFilePart::getPartName(StringBuffer &partname)
     const char *mask=parent.queryPartMask();
     if (!mask||!*mask) {
         const char *err ="CDistributedFilePart::getPartName cannot determine part name (no mask)";
-        ERRLOG(err);
-        throw MakeStringException(-1,err);
+        ERRLOG("%s", err);
+        throw MakeStringException(-1, "%s", err);
     }
     expandMask(partname,mask,partIndex,parent.numParts());
     return partname;

+ 1 - 2
dali/base/dadiags.cpp

@@ -191,8 +191,7 @@ public:
                     bool disconnect;
                     params.read(connectionId);
                     params.read(disconnect);
-                    StringBuffer messageStr("Dalidiag request to unlock connection id: ");
-                    PROGLOG(messageStr.appendf("%"I64F"x", connectionId).str());
+                    PROGLOG("Dalidiag request to unlock connection id: %"I64F"x", connectionId);
                     StringBuffer connectionInfo;
                     bool success = querySDSServer().unlock(connectionId, disconnect, connectionInfo);
                     mb.append(success);

+ 15 - 15
dali/base/dasds.cpp

@@ -1271,7 +1271,7 @@ public:
         if ((unsigned)-1 == sz)
         {
             StringBuffer s("Missing external file ");
-            Owned<IException> e = MakeSDSException(SDSExcpt_MissingExternalFile, filename.str());
+            Owned<IException> e = MakeSDSException(SDSExcpt_MissingExternalFile, "%s", filename.str());
             LOG(MCoperatorWarning, unknownJob, e, s.str()); 
             StringBuffer str("EXTERNAL BINARY FILE: \"");
             str.append(filename.str()).append("\" MISSING");
@@ -1306,7 +1306,7 @@ public:
             StringBuffer s("Missing external file ");
             if (*_name)
                 s.append("in property ").append(_name);
-            Owned<IException> e = MakeSDSException(SDSExcpt_MissingExternalFile, filename.str());
+            Owned<IException> e = MakeSDSException(SDSExcpt_MissingExternalFile, "%s", filename.str());
             LOG(MCoperatorWarning, unknownJob, e, s.str()); 
             if (withValue)
             {
@@ -1376,7 +1376,7 @@ public:
         if ((unsigned)-1 == sz)
         {
             StringBuffer s("Missing external file ");
-            Owned<IException> e = MakeSDSException(SDSExcpt_MissingExternalFile, filename.str());
+            Owned<IException> e = MakeSDSException(SDSExcpt_MissingExternalFile, "%s", filename.str());
             LOG(MCoperatorWarning, unknownJob, e, s.str());
             StringBuffer str("EXTERNAL BINARY FILE: \"");
             str.append(filename.str()).append("\" MISSING");
@@ -1407,7 +1407,7 @@ public:
             StringBuffer s("Missing external file ");
             if (*_name)
                 s.append("in property ").append(_name);
-            Owned<IException> e = MakeSDSException(SDSExcpt_MissingExternalFile, filename.str());
+            Owned<IException> e = MakeSDSException(SDSExcpt_MissingExternalFile, "%s", filename.str());
             LOG(MCoperatorWarning, unknownJob, e, s.str());
             if (withValue)
             {
@@ -1476,7 +1476,7 @@ public:
         if (!ifile->exists())
         {
             StringBuffer s("Missing external file ");
-            Owned<IException> e = MakeSDSException(SDSExcpt_MissingExternalFile, filename.str());
+            Owned<IException> e = MakeSDSException(SDSExcpt_MissingExternalFile, "%s", filename.str());
             LOG(MCoperatorWarning, unknownJob, e, s.str());
             StringBuffer str("EXTERNAL XML FILE: \"");
             str.append(filename.str()).append("\" MISSING");
@@ -1506,7 +1506,7 @@ public:
             const char *name = owner.queryName();
             if (name && *name)
                 s.append("in property ").append(name);
-            Owned<IException> e = MakeSDSException(SDSExcpt_MissingExternalFile, filename.str());
+            Owned<IException> e = MakeSDSException(SDSExcpt_MissingExternalFile, "%s", filename.str());
             LOG(MCoperatorWarning, unknownJob, e, s.str());
             StringBuffer str("EXTERNAL XML FILE: \"");
             str.append(filename.str()).append("\" MISSING");
@@ -2993,7 +2993,7 @@ class CLockInfo : public CInterface, implements IInterface
                             StringBuffer out("Removing stale connection session [");
                             out.appendf("%"I64F"x], connectionId [%"I64F"x]", lD->sessId, * ((ConnectionId *) imap.getKey()));
                             out.append(" xpath [").append(xpath).append("]");
-                            PROGLOG(out.str());
+                            PROGLOG("%s", out.str());
                             querySessionManager().stopSession(lD->sessId, true);
                             ret = true;
                         }
@@ -3009,7 +3009,7 @@ class CLockInfo : public CInterface, implements IInterface
                                 out.append(" [");
                                 out.appendf("%"I64F"x], connectionId [%"I64F"x]", lD->sessId, * ((ConnectionId *) imap.getKey()));
                                 out.append(" xpath [").append(xpath).append("]");
-                                PROGLOG(out.str());
+                                PROGLOG("%s", out.str());
                                 queryCoven().disconnect(node);
                                 ret = true;
                             }
@@ -3171,7 +3171,7 @@ public:
                             waiting--;
                             StringBuffer s("Infinite timeout lock still waiting: ");
                             getLockInfo(s);
-                            PROGLOG(s.str());
+                            PROGLOG("%s", s.str());
                         }
                         {
                             CHECKEDCRITICALUNBLOCK(crit, fakeCritTimeout);
@@ -3874,7 +3874,7 @@ void CSDSTransactionServer::processMessage(CMessageBuffer &mb)
                     {
                         StringBuffer str("Dali client passing sessionid=0 to connect (xpath=");
                         str.append(xpath).append(", mode=").append(mode).append(", connectionId=").appendf("%"I64F"x", connectionId).append(")");
-                        WARNLOG(str.str());
+                        WARNLOG("%s", str.str());
                     }
                     mb.clear();
                     mb.append((int)DAMP_SDSREPLY_OK);
@@ -3930,7 +3930,7 @@ void CSDSTransactionServer::processMessage(CMessageBuffer &mb)
                             {
                                 StringBuffer str("Dali client passing sessionid=0 to multi connect (xpath=");
                                 str.append(xpath).append(", mode=").append(mode).append(", connectionId=").appendf("%"I64F"x", connectionId).append(")");
-                                WARNLOG(str.str());
+                                WARNLOG("%s", str.str());
                             }
                             CRemoteConnection *conn = new CRemoteConnection(*SDSManager, connectionId, xpath, id, mode, timeout);
                             assertex(conn);
@@ -4304,7 +4304,7 @@ void CSDSTransactionServer::processMessage(CMessageBuffer &mb)
         {
             s.append(" in xpath '").append(xpath).append("'");
             e->Release();
-            e = MakeSDSException(SDSExcpt_IPTError, s.str());   
+            e = MakeSDSException(SDSExcpt_IPTError, "%s", s.str());
         }
         mb.append(e->errorCode());
         mb.append(e->errorMessage(s.clear()));
@@ -4531,7 +4531,7 @@ IPropertyTree *loadStore(const char *storeFilename, IPTreeMaker *iMaker, unsigne
         OwnedIFile iFileStore = createIFile(storeFilename);
         OwnedIFileIO iFileIOStore = iFileStore->open(IFOread);
         if (!iFileIOStore)
-            throw MakeSDSException(SDSExcpt_OpenStoreFailed, storeFilename);
+            throw MakeSDSException(SDSExcpt_OpenStoreFailed, "%s", storeFilename);
 
         Owned<IFileIOStream> fstream = createIOStream(iFileIOStore);
         Owned<ICrcIOStream> crcPipeStream = createCrcPipeStream(fstream);
@@ -5090,7 +5090,7 @@ public:
             {
                 noErrors = false;
                 StringBuffer s;
-                LOG(MCoperatorWarning, unknownJob, s.append("Delta '").append(filename).append("' crc mismatch").str());
+                LOG(MCoperatorWarning, unknownJob, "%s", s.append("Delta '").append(filename).append("' crc mismatch").str());
             }
         }
         return noErrors;
@@ -6893,7 +6893,7 @@ CServerConnection *CCovenSDSManager::createConnectionInstance(CRemoteTreeBase *r
                 if (tree)
                 {
                     if (match)
-                        throw MakeSDSException(SDSExcpt_AmbiguousXpath, "Ambiguous: ", _xpath);
+                        throw MakeSDSException(SDSExcpt_AmbiguousXpath, "Ambiguous: %s", _xpath);
                 }
                 else
                 {

+ 1 - 1
dali/base/dasds.ipp

@@ -461,7 +461,7 @@ private:
     StringBuffer errMsg;
 };
 
-ISDSException *MakeSDSException(int errorCode, const char *errorMsg = NULL, ...);
+ISDSException *MakeSDSException(int errorCode, const char *errorMsg = NULL, ...) __attribute__((format(printf, 2, 3)));
 
 inline void throwMbException(const char *errorMsg, MemoryBuffer &mb)
 {

+ 3 - 3
dali/dfu/dfurunkdp.cpp

@@ -170,7 +170,7 @@ public:
                     if (sz) {
                         StringBuffer s;
                         fio->read(0,sz,s.reserve(sz));
-                        throw MakeStringException(-1,s.str());
+                        throw MakeStringException(-1, "%s", s.str());
                     }
                     try {
                         fio.clear();
@@ -225,7 +225,7 @@ static void runKDPNodes(const char *title,CIArrayOf<CDKDPitem> &nodes)
                         StringBuffer err;
                         err.append(title).append(" failed to start on node ");
                         it.queryEP().getUrlStr(err);
-                        throw MakeStringException(-1,err.str());
+                        throw MakeStringException(-1, "%s", err.str());
                     }
                     Sleep(5000); // no point in rushing when some left
                 }
@@ -246,7 +246,7 @@ static void runKDPNodes(const char *title,CIArrayOf<CDKDPitem> &nodes)
                         StringBuffer err;
                         err.append(title).append(" failed to finish on node ");
                         it.queryEP().getUrlStr(err);
-                        throw MakeStringException(-1,err.str());
+                        throw MakeStringException(-1, "%s", err.str());
                     }
                     Sleep(5000); // no point in rushing when some left
                 }

+ 1 - 1
dali/dfu/dfuwu.cpp

@@ -2051,7 +2051,7 @@ public:
         int code = et->getPropInt("@exceptionCode");
         StringBuffer msg;
         et->getProp("@exceptionMessage",msg);
-        cur.setown(MakeStringException(code,msg.str()));
+        cur.setown(MakeStringException(code, "%s", msg.str()));
         return true;
     }
 

+ 1 - 1
dali/dfuXRefLib/dfuxreflib.cpp

@@ -349,7 +349,7 @@ static unsigned short getDafsPort(const SocketEndpoint &ep,unsigned &numfails,Cr
     else 
         numfails++;
 #else
-    throw MakeStringException(-1,err.str());
+    throw MakeStringException(-1, "%s", err.str());
 #endif
     return 0;
 }

+ 3 - 3
dali/ft/filecopy.cpp

@@ -728,7 +728,7 @@ void FileSprayer::afterTransfer()
                 }
                 if (recoveryConnection)
                     recoveryConnection->commit();
-                throw MakeStringException(DFTERR_InputCrcMismatch, errorText.str());
+                throw MakeStringException(DFTERR_InputCrcMismatch, "%s", errorText.str());
             }
         }
     }
@@ -2253,7 +2253,7 @@ void FileSprayer::setError(const SocketEndpoint & ep, IException * e)
     {
         StringBuffer url;
         ep.getUrlStr(url);
-        error.setown(MakeStringException(e->errorCode(), e->errorMessage(url.append(": ")).str()));
+        error.setown(MakeStringException(e->errorCode(), "%s", e->errorMessage(url.append(": ")).str()));
     }
 }
 
@@ -2819,7 +2819,7 @@ void FileSprayer::updateTargetProperties()
         }
 
         if (failedParts.length())
-            error.setown(MakeStringException(DFTERR_InputOutputCrcMismatch, failedParts.str()));
+            error.setown(MakeStringException(DFTERR_InputOutputCrcMismatch, "%s", failedParts.str()));
 
         IPropertyTree &curProps = distributedTarget->lockProperties();
         if (calcCRC())

+ 1 - 1
deployment/deploy/DeploymentEngine.cpp

@@ -901,7 +901,7 @@ void CDeploymentEngine::writeFile(const char* filename, const char* str, EnvMach
             String* perr = errmsg.substring(0, index > 0? index : errmsg.length());
             output.clear().appendf("%s", perr->toCharArray());
             delete perr;
-            throw MakeStringException(-1, output.str());
+            throw MakeStringException(-1, "%s", output.str());
         }
     }
     else

+ 2 - 2
deployment/deployutils/configenvhelper.cpp

@@ -889,7 +889,7 @@ bool CConfigEnvHelper::EnsureInRange(const char* psz, UINT low, UINT high, const
     if (!rc)
     {
         msg.append('.');
-        throw MakeStringException(-1, msg.str());
+        throw MakeStringException(-1, "%s", msg.str());
     }
     return rc;
 }
@@ -1021,7 +1021,7 @@ bool CConfigEnvHelper::handleRoxieSlaveConfig(const char* xmlArg)
     catch (IException *e)
     {
         StringBuffer msg;
-        throw MakeStringException(-1, e->errorMessage(msg).str());
+        throw MakeStringException(-1, "%s", e->errorMessage(msg).str());
     }
     catch (...)
     {

+ 1 - 1
deployment/deployutils/deployutils.cpp

@@ -3683,7 +3683,7 @@ bool validateEnv(IConstEnvironment* pConstEnv)
       }
 
       e->Release();
-      throw MakeStringException(-1, newMsg.append(errMsg.str()));
+      throw MakeStringException(-1, "%s", newMsg.append(errMsg.str()).str());
     }
     else
       throw e;

+ 4 - 4
ecl/eclagent/eclagent.cpp

@@ -1374,7 +1374,7 @@ ILocalOrDistributedFile *EclAgent::resolveLFN(const char *fname, const char *err
                 if (optional) return NULL;
                 if (!errorTxt) return NULL;
                 StringBuffer errorMsg(errorTxt);
-                throw MakeStringException(0, errorMsg.append(": Superkey '").append(lfn).append("' is empty").str());
+                throw MakeStringException(0, "%s", errorMsg.append(": Superkey '").append(lfn).append("' is empty").str());
             }
 
             if (noteRead)
@@ -1389,7 +1389,7 @@ ILocalOrDistributedFile *EclAgent::resolveLFN(const char *fname, const char *err
         if (optional) return NULL;
         if (!errorTxt) return NULL;
         StringBuffer errorMsg(errorTxt);
-        throw MakeStringException(0, errorMsg.append(": Logical file name '").append(lfn).append("' could not be resolved").str());
+        throw MakeStringException(0, "%s", errorMsg.append(": Logical file name '").append(lfn).append("' could not be resolved").str());
     }
     return ldFile.getClear();
 }
@@ -2211,13 +2211,13 @@ void EclAgentWorkflowMachine::doExecutePersistItem(IRuntimeWorkflowItem & item)
     {
         StringBuffer errmsg;
         errmsg.append("Internal error in generated code: for wfid ").append(wfid).append(", persist CRC wfid ").append(item.queryPersistWfid()).append(" did not call returnPersitVersion");
-        throw MakeStringException(0, errmsg.str());
+        throw MakeStringException(0, "%s", errmsg.str());
     }
     if(strcmp(name.str(), persist->logicalName.get()) != 0)
     {
         StringBuffer errmsg;
         errmsg.append("Failed workflow/persist consistency check: wfid ").append(wfid).append(", WU persist name ").append(name.str()).append(", runtime persist name ").append(persist->logicalName.get());
-        throw MakeStringException(0, errmsg.str());
+        throw MakeStringException(0, "%s", errmsg.str());
     }
     if(agent.arePersistsFrozen())
     {

+ 3 - 3
ecl/eclagent/eclgraph.cpp

@@ -1638,7 +1638,7 @@ void EclAgent::executeThorGraph(const char * graphName)
         if (!conversation->send(msg)) {
             StringBuffer s("Failed to send query to Thor on ");
             thorMaster.getUrlStr(s);
-            throw MakeStringException(-1, s.str()); // maybe retry?
+            throw MakeStringException(-1, "%s", s.str()); // maybe retry?
         }
 
         StringBuffer eps;
@@ -1650,7 +1650,7 @@ void EclAgent::executeThorGraph(const char * graphName)
             {
                 StringBuffer s("Failed to receive reply from thor ");
                 thorMaster.getUrlStr(s);
-                throw MakeStringException(-1, s.str());
+                throw MakeStringException(-1, "%s", s.str());
             }
         }
         catch (IException *e)
@@ -1659,7 +1659,7 @@ void EclAgent::executeThorGraph(const char * graphName)
             thorMaster.getUrlStr(s);
             s.append("; (").append(e->errorCode()).append(", ");
             e->errorMessage(s).append(")");
-            throw MakeStringException(-1, s.str());
+            throw MakeStringException(-1, "%s", s.str());
         }
         ThorReplyCodes replyCode;
         reply.read((unsigned &)replyCode);

+ 2 - 2
ecl/hql/hqlesp.cpp

@@ -191,8 +191,8 @@ void WebServicesExtractor::getAttributeText(StringBuffer & text, const char* att
     {
         StringBuffer txt;
         txt.append("Could not read attribute: ").append(attributeName);
-        DBGLOG(txt.toCharArray());
-        throw MakeStringException(ERR_NO_ATTRIBUTE_TEXT, txt.str());
+        DBGLOG("%s", txt.toCharArray());
+        throw MakeStringException(ERR_NO_ATTRIBUTE_TEXT, "%s", txt.str());
     }
 
     symbol->getTextBuf(text);

+ 1 - 1
ecl/hql/hqlexpr.cpp

@@ -4984,7 +4984,7 @@ IHqlDataset *CHqlDataset::queryTable()
 
     StringBuffer s("queryDataset() return NULL for: ");
     s.append(getOpString(op));
-    throw MakeStringException(2,s.str());
+    throw MakeStringException(2, "%s", s.str());
 }
 
 void CHqlDataset::sethash() 

+ 1 - 1
ecl/hql/hqlscope.cpp

@@ -131,7 +131,7 @@ void ScopeConsistencyChecker::ensureActive(IHqlExpression * ds)
         s.append("Dataset isn't normalized");
     else
         s.append("Dataset isn't in scope");
-    throw MakeStringException(ERR_ASSERT_WRONGSCOPING, s.str());
+    throw MakeStringException(ERR_ASSERT_WRONGSCOPING, "%s", s.str());
 }
 
 

+ 1 - 1
ecl/hqlcpp/hqlcpp.cpp

@@ -3316,7 +3316,7 @@ void HqlCppTranslator::buildExpr(BuildCtx & ctx, IHqlExpression * expr, CHqlBoun
     toECL(expr, msg, true);
 //  expr->toString(msg);
     msg.append(")");
-    throw MakeStringException(HQLERR_UnexpectedOperator, msg.str());
+    throw MakeStringException(HQLERR_UnexpectedOperator, "%s", msg.str());
     doBuildPureSubExpr(ctx, expr, tgt);
 }
 

+ 1 - 1
ecl/hqlcpp/hqlhtcpp.cpp

@@ -6105,7 +6105,7 @@ ABoundActivity * HqlCppTranslator::buildActivity(BuildCtx & ctx, IHqlExpression
             case no_preload:
                 {
                     StringBuffer s;
-                    DBGLOG(getExprECL(expr, s).str());
+                    DBGLOG("%s", getExprECL(expr, s).str());
                     throwError(HQLERR_TooComplicatedToPreload);
                 }
             case no_sub:

+ 2 - 2
ecl/hqlcpp/hqliproj.cpp

@@ -620,7 +620,7 @@ void ComplexImplicitProjectInfo::trace()
     if (original->queryName())
         s.append(original->queryName()).append(" := ");
     s.append(getOpString(original->getOperator()));
-    DBGLOG(s.str());
+    DBGLOG("%s", s.str());
 
     switch (childDatasetType)
     {
@@ -657,7 +657,7 @@ void ComplexImplicitProjectInfo::trace(const char * label, const UsedFieldSet &
     s.append("  ").append(label).append(": ");
     fields.getText(s);
 
-    DBGLOG(s.str());
+    DBGLOG("%s", s.str());
 }
 
 

+ 2 - 2
ecl/hqlcpp/hqlresource.cpp

@@ -730,7 +730,7 @@ void ResourceGraphInfo::display()
     s.append(")");
     if (isUnconditional)
         s.append(" <unconditional>");
-    DBGLOG(s.str());
+    DBGLOG("%s", s.str());
 }
 
 void ResourceGraphInfo::expandDependants(ResourceGraphArray & target)
@@ -4383,7 +4383,7 @@ void EclResourcer::trace()
 {
     StringBuffer s;
     display(s);
-    DBGLOG(s.str());
+    DBGLOG("%s", s.str());
 }
 
 //---------------------------------------------------------------------------

+ 3 - 3
ecl/hqlcpp/hqlttcpp.cpp

@@ -5448,7 +5448,7 @@ IHqlExpression * WorkflowTransformer::extractCommonWorkflow(IHqlExpression * exp
         if (expr->queryName())
             s.append("[").append(expr->queryName()).append("] ");
         s.append(" to common up code between workflow items");
-        DBGLOG(s.str());
+        DBGLOG("%s", s.str());
         translator.addWorkunitException(ExceptionSeverityInformation, HQLWRN_TryAddingIndependent, s.str(), location);
         if (!translator.queryOptions().performWorkflowCse)
             return LINK(transformed);
@@ -5462,7 +5462,7 @@ IHqlExpression * WorkflowTransformer::extractCommonWorkflow(IHqlExpression * exp
     if (expr->queryName())
         s.append("[").append(expr->queryName()).append("] ");
     s.append(" to common up between workflow items [").append(wfid).append("]");
-    DBGLOG(s.str());
+    DBGLOG("%s", s.str());
     translator.addWorkunitException(ExceptionSeverityInformation, 0, s.str(), location);
 
     GlobalAttributeInfo info("spill::wfa", "wfa");
@@ -7369,7 +7369,7 @@ IHqlExpression * AutoScopeMigrateTransformer::createTransformed(IHqlExpression *
         if (expr->queryName())
             s.append("[").append(expr->queryName()).append("] ");
         s.append("as an item to hoist");
-        DBGLOG(s.str());
+        DBGLOG("%s", s.str());
 
         GlobalAttributeInfo info("spill::auto","auto");
         info.extractGlobal(transformed, isRoxie);

+ 5 - 5
ecl/hthor/hthor.cpp

@@ -784,7 +784,7 @@ void CHThorDiskWriteActivity::checkSizeLimit()
     {
         StringBuffer msg;
         msg.append("Exceeded disk write size limit of ").append(sizeLimit).append(" while writing file ").append(mangledHelperFileName.str());
-        throw MakeStringException(0, msg.str());
+        throw MakeStringException(0, "%s", msg.str());
     }
 }
 
@@ -974,7 +974,7 @@ void throwPipeProcessError(unsigned err, char const * preposition, char const *
             e->Release();
         }
     }
-    throw MakeStringException(2, msg.str());
+    throw MakeStringException(2, "%s", msg.str());
 }
 
 CHThorPipeWriteActivity::CHThorPipeWriteActivity(IAgentContext &_agent, unsigned _activityId, unsigned _subgraphId, IHThorPipeWriteArg &_arg, ThorActivityKind _kind) : CHThorActivityBase(_agent, _activityId, _subgraphId, _arg, _kind), helper(_arg)
@@ -1161,7 +1161,7 @@ void CHThorIndexWriteActivity::execute()
             {
                 StringBuffer msg;
                 msg.append("Exceeded disk write size limit of ").append(sizeLimit).append(" while writing index ").append(helper.getFileName());
-                throw MakeStringException(0, msg.str());
+                throw MakeStringException(0, "%s", msg.str());
             }
             reccount++;
         }
@@ -7503,7 +7503,7 @@ void CHThorDiskReadBaseActivity::gatherInfo(IFileDescriptor * fileDesc)
             {
                 StringBuffer msg;
                 msg.append("DFS and code generated group info. differs: DFS(").append(grouped ? "grouped" : "ungrouped").append("), CodeGen(").append(grouped ? "ungrouped" : "grouped").append("), using DFS info");
-                WARNLOG(msg.str());
+                WARNLOG("%s", msg.str());
                 agent.addWuException(msg.str(), 0, ExceptionSeverityWarning, "hthor");
             }
         }
@@ -7540,7 +7540,7 @@ void CHThorDiskReadBaseActivity::gatherInfo(IFileDescriptor * fileDesc)
             {
                 StringBuffer msg;
                 msg.append("Ignoring compression attribute on file ").append(mangledHelperFileName.str()).append(", which is not published as compressed");
-                WARNLOG(msg.str());
+                WARNLOG("%s", msg.str());
                 agent.addWuException(msg.str(), 0, ExceptionSeverityWarning, "hthor");
                 compressed = true;
             }

+ 1 - 1
ecl/hthor/hthor.ipp

@@ -296,7 +296,7 @@ static bool verifyFormatCrc(unsigned helperCrc, IDistributedFile * df, char cons
             if(super)
                 msg.append(" (in super").append(isIndex ? "index" : "file").append(" ").append(super).append(")");
             if(fail)
-                throw MakeStringException(0, msg.str());
+                throw MakeStringException(0, "%s", msg.str());
             WARNLOG("%s", msg.str());
             return false;
         }

+ 3 - 3
ecl/hthor/hthorkey.cpp

@@ -124,7 +124,7 @@ IRecordLayoutTranslator * getRecordLayoutTranslator(IDefRecordMeta const * activ
         StringBuffer activityMetaDesc;
         getRecordMetaAsString(activityMetaDesc, activityMeta);
         ERRLOG("RecordLayoutTranslator error: %s\nDisk meta: %s\nActivity meta: %s", m.str(), diskMetaDesc.str(), activityMetaDesc.str());
-        throw MakeStringException(0, m.str());
+        throw MakeStringException(0, "%s", m.str());
     }
 }
 
@@ -305,7 +305,7 @@ public:
 
     virtual void fail(char const * msg)
     {
-        throw MakeStringException(0, msg);
+        throw MakeStringException(0, "%s", msg);
     }
 
 protected:
@@ -4064,7 +4064,7 @@ protected:
 
     virtual void fail(char const * msg)
     {
-        throw MakeStringException(0, msg);
+        throw MakeStringException(0, "%s", msg);
     }
 };
 

+ 2 - 2
esp/bindings/SOAP/Platform/soapbind.cpp

@@ -207,7 +207,7 @@ int CHttpSoapBinding::HandleSoapRequest(CHttpRequest* request, CHttpResponse* re
         const char* detail = soapresponse->get_err();
         if (detail && *detail)
             msg.appendf(" [%s]", detail);
-        throw MakeStringException(500,msg);
+        throw MakeStringException(500, "%s", msg.str());
     }
     else if(status == SOAP_CLIENT_ERROR || status == SOAP_REQUEST_TYPE_ERROR)
     {
@@ -215,7 +215,7 @@ int CHttpSoapBinding::HandleSoapRequest(CHttpRequest* request, CHttpResponse* re
         const char* detail = soapresponse->get_err();
         if (detail && *detail)
             msg.appendf(" [%s]", detail);
-        throw MakeStringException(400,msg);
+        throw MakeStringException(400, "%s", msg.str());
     }
     else if(status == SOAP_AUTHENTICATION_REQUIRED)
         response->sendBasicChallenge(m_challenge_realm.str(), false);

+ 2 - 2
esp/bindings/SOAP/client/soapclient.cpp

@@ -193,7 +193,7 @@ int CSoapClient::postRequest(const char* contenttype, const char* soapaction, IR
         if (soap_response->get_err())
             errmsg.appendf("[%s]", soap_response->get_err());
 
-        throw MakeStringException(retstatus, errmsg);
+        throw MakeStringException(retstatus, "%s", errmsg.str());
     }
 
 #if defined(DEBUG_HTTP_)
@@ -373,7 +373,7 @@ int CSoapClient::postRequest(IRpcMessage & rpccall, StringBuffer & responsebuf,
         else if(retstatus == SOAP_AUTHENTICATION_ERROR)
             errmsg = "SOAP authentication error";
 
-        throw MakeStringException(retstatus, errmsg);
+        throw MakeStringException(retstatus, "%s", errmsg);
     }
 
     if(soap_response->get_text_length() == 0)

+ 5 - 5
esp/bindings/http/client/httpclient.cpp

@@ -206,7 +206,7 @@ int CHttpClient::connect(StringBuffer& errmsg)
         if (!ep.set(m_host.get(), m_port))
         {
             errmsg.appendf("Bad host name/ip: %s", m_host.get());
-            ERRLOG(errmsg);
+            ERRLOG("%s", errmsg.str());
             return -1;
         }
         //TODO: should it be 443 for HTTPS??
@@ -218,7 +218,7 @@ int CHttpClient::connect(StringBuffer& errmsg)
         if (!ep.set(m_proxy.str()))
         {
             errmsg.appendf("Bad proxy name/ip: %s", m_proxy.str());
-            ERRLOG(errmsg);
+            ERRLOG("%s", errmsg.str());
             return -1;
         }
         //TODO: should it be 443 for HTTPS??
@@ -254,7 +254,7 @@ int CHttpClient::connect(StringBuffer& errmsg)
     {
         StringBuffer errMsg;
         errmsg.appendf("Exception in CHttpClient::connect... %d==>%s", excpt->errorCode(), excpt->errorMessage(errMsg).str());
-        DBGLOG(errmsg);
+        DBGLOG("%s", errmsg.str());
         StringBuffer url;
         ERRLOG("Connect to %s failed: %s", ep.getUrlStr(url).str(),errMsg.str());
         excpt->Release();
@@ -265,7 +265,7 @@ int CHttpClient::connect(StringBuffer& errmsg)
     {
         DBGLOG(">>Exception in CHttpClient::connect...");
         errmsg.appendf("Internal error: unexpected exception in CHttpClient::connect()");
-        ERRLOG(errmsg);
+        ERRLOG("%s", errmsg.str());
         m_socket = NULL;
         return -1;
     }
@@ -717,7 +717,7 @@ int CHttpClient::postRequest(ISoapMessage &req, ISoapMessage& resp)
     }
     else
     {
-        DBGLOG(errmsg.str());
+        DBGLOG("%s", errmsg.str());
 
         StringBuffer msg;
         if (me->ordinality())

+ 1 - 1
esp/bindings/http/platform/httpbinding.cpp

@@ -774,7 +774,7 @@ static void filterXmlBySchema(IPTree* in, IXmlType* type, const char* tag, Strin
         {
             VStringBuffer s("*** Invalid array definition: tag=%s, itemName=%s", tag, itemName?itemName:"NULL");
             out.append(s);
-            ERRLOG(s);
+            ERRLOG("%s", s.str());
             return;
         }
 

+ 1 - 1
esp/bindings/http/platform/httpservice.cpp

@@ -637,7 +637,7 @@ int CEspHttpServer::onRunCGI(CHttpRequest* request, CHttpResponse* response, con
                     StringBuffer hstr;
                     hstr.append(("HTTP_")).append(hname).append('=').append(finger);
                     env.append(hstr.str());
-                    DBGLOG(hstr.str());
+                    DBGLOG("%s", hstr.str());
                 }
             }
         }

+ 1 - 1
esp/services/WsDeploy/WsDeployEngine.cpp

@@ -651,7 +651,7 @@ bool CWsDeployEngine::processException(const char* processType, const char* proc
     if (szCaption && *szCaption)
       DBGLOG("%s: %s", szCaption, msg.str());
     else
-      DBGLOG(msg.str());
+      DBGLOG("%s", msg.str());
 
   }
 

+ 8 - 8
esp/services/WsDeploy/WsDeployService.cpp

@@ -670,13 +670,13 @@ bool CWsDeployFileInfo::navMenuEvent(IEspContext &context,
           else
             sMsg.append(":\n\n").append(sErrMsg);
 
-          throw MakeStringException(0, sMsg);
+          throw MakeStringException(0, "%s", sMsg.str());
         }
         else
         {
           StringBuffer sMsg;
           sMsg.append("Error locking environment. ").append(sErrMsg.str());
-          throw MakeStringException(-1, sMsg.str());
+          throw MakeStringException(-1, "%s", sMsg.str());
         }
       }
     }
@@ -764,13 +764,13 @@ bool CWsDeployFileInfo::navMenuEvent(IEspContext &context,
           else
             sMsg.append(":\n\n").append(sErrMsg);
 
-          throw MakeStringException(0, sMsg);
+          throw MakeStringException(0, "%s", sMsg.str());
         }
         else
         {
           StringBuffer sMsg;
           sMsg.append("Error unlocking environment. ").append(sErrMsg.str());
-          throw MakeStringException(-1, sMsg.str());
+          throw MakeStringException(-1, "%s", sMsg.str());
         }
       }
     }
@@ -2593,9 +2593,9 @@ bool CWsDeployFileInfo::getValue(IEspContext &context, IEspGetValueRequest &req,
           if(m_userWithLock.length())
           {
            if (strcmp(sbName.str(), m_userWithLock.str()) || strcmp(sbUserIp.str(), m_userIp.str()))
-             sbMultiple.appendf(sArray.item(i)).append("=").appendf("Cannot get access to Wizard mode as Environment is currently being configured in wizard mode on machine ").append(m_userIp.str());
+             sbMultiple.append(sArray.item(i)).append("=").append("Cannot get access to Wizard mode as Environment is currently being configured in wizard mode on machine ").append(m_userIp.str());
            else if(!strcmp(sbName.str(), m_userWithLock.str()) && !strcmp(sbUserIp.str(),m_userIp.str()))
-             sbMultiple.appendf(sArray.item(i)).append("=").appendf("Another browser window already has write access on machine ").append(m_userIp.str()).appendf(".Please use that window.");
+             sbMultiple.append(sArray.item(i)).append("=").append("Another browser window already has write access on machine ").append(m_userIp.str()).append(".Please use that window.");
            else
             sbMultiple.append(sArray.item(i)).append("=''");
 
@@ -5332,7 +5332,7 @@ void CWsDeployFileInfo::saveEnvironment(IEspContext* pContext, IConstWsDeployReq
       else
         sMsg.append(":\n\n").append(sErrMsg);
 
-      throw MakeStringException(0, sMsg);
+      throw MakeStringException(0, "%s", sMsg.str());
     }
   }
 }
@@ -6038,7 +6038,7 @@ bool CWsDeployExCE::onGetValue(IEspContext &context, IEspGetValueRequest &req, I
             {
               StringBuffer encryptedPasswd ;
               encrypt(encryptedPasswd , sArray.item(x));
-              sbMultiple.appendf(encryptedPasswd.str()); 
+              sbMultiple.append(encryptedPasswd.str()); 
                 if(sbMultiple.length())
                  sbMultiple.append(",");
             }

+ 1 - 1
esp/services/ws_dfu/ws_dfuService.cpp

@@ -1241,7 +1241,7 @@ bool CWsDfuEx::DFUDeleteFiles(IEspContext &context, IEspDFUArrayActionRequest &r
                     if (errorStr.length() > 0)
                     {
                         returnStr.appendf("<Message><Value>%s</Value></Message>",errorStr.str());
-                        DBGLOG(errorStr.str());
+                        DBGLOG("%s", errorStr.str());
                     }
                     else 
                     {

+ 1 - 1
esp/services/ws_fs/ws_fsService.cpp

@@ -678,7 +678,7 @@ bool CFileSprayEx::GetArchivedDFUWorkunits(IEspContext &context, IEspGetDFUWorku
     {
         StringBuffer msg;
         msg.appendf("Cannot connect to archive server at %s",sashaAddress.str());
-        throw MakeStringException(ECLWATCH_CANNOT_CONNECT_ARCHIVE_SERVER, msg.str());
+        throw MakeStringException(ECLWATCH_CANNOT_CONNECT_ARCHIVE_SERVER, "%s", msg.str());
     }
 
     IArrayOf<IEspDFUWorkunit> results;

+ 1 - 1
esp/services/ws_machine/ws_machineService.cpp

@@ -540,7 +540,7 @@ void Cws_machineEx::RunMachineQuery(IEspContext &context, StringArray &addresses
          {
             StringBuffer msg;
             e->errorMessage(msg);
-              WARNLOG(msg.str());
+              WARNLOG("%s", msg.str());
               e->Release();
           }
           catch(...)

+ 18 - 18
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -3469,7 +3469,7 @@ private:
 
             StringBuffer msg;
             msg.appendf("ESP Access Denied: User %s does not have rights to access any workunits.", context.queryUserId());
-            throw MakeStringException(ECLWATCH_ECL_WU_ACCESS_DENIED, msg.str());
+            throw MakeStringException(ECLWATCH_ECL_WU_ACCESS_DENIED, "%s", msg.str());
         }
     }
 
@@ -3769,7 +3769,7 @@ void CWsWorkunitsEx::doWUQueryWithSort(IEspContext &context, IEspWUQueryRequest
 
         StringBuffer msg;
         msg.appendf("ESP Access Denied: User %s does not have rights to access any workunits.", context.queryUserId());
-        throw MakeStringException(ECLWATCH_ECL_WU_ACCESS_DENIED, msg.str());
+        throw MakeStringException(ECLWATCH_ECL_WU_ACCESS_DENIED, "%s", msg.str());
     }
 
     StringBuffer user;
@@ -4440,7 +4440,7 @@ void CWsWorkunitsEx::processWorkunit(IConstWorkUnit *workunit, const char* wuid,
         StringBuffer msg;
         e->errorMessage(msg);
         e->Release();
-        throw MakeStringException(ECLWATCH_QUERY_NOT_FOUND_FOR_WU, msg.str());
+        throw MakeStringException(ECLWATCH_QUERY_NOT_FOUND_FOR_WU, "%s", msg.str());
     }
 
 
@@ -4467,7 +4467,7 @@ void CWsWorkunitsEx::doWUQueryForArchivedWUs(IEspContext &context, IEspWUQueryRe
 
         StringBuffer msg;
         msg.appendf("ESP Access Denied: User %s does not have rights to access any workunits.", context.queryUserId());
-        throw MakeStringException(ECLWATCH_ECL_WU_ACCESS_DENIED, msg.str());
+        throw MakeStringException(ECLWATCH_ECL_WU_ACCESS_DENIED, "%s", msg.str());
     }
 
     double version = context.getClientVersion();
@@ -4602,7 +4602,7 @@ void CWsWorkunitsEx::doWUQueryForArchivedWUs(IEspContext &context, IEspWUQueryRe
                 {
                     StringBuffer msg;
                     msg.appendf("Cannot connect to archive server at %s.",sashaAddress);
-                    throw MakeStringException(ECLWATCH_CANNOT_CONNECT_ARCHIVE_SERVER, msg.str());
+                    throw MakeStringException(ECLWATCH_CANNOT_CONNECT_ARCHIVE_SERVER, "%s", msg.str());
                 }
 
                 unsigned actualCount = cmd->numIds();
@@ -5408,7 +5408,7 @@ void CWsWorkunitsEx::getInfo(IEspContext &context,const char* wuid0,IEspECLWorku
 
         StringBuffer eMsg;
         e->errorMessage(eMsg);
-        ERRLOG(eMsg.str()); //log original exception
+        ERRLOG("%s", eMsg.str()); //log original exception
         e->Release();
     }
 
@@ -5458,7 +5458,7 @@ void CWsWorkunitsEx::getInfo(IEspContext &context,const char* wuid0,IEspECLWorku
 
         StringBuffer eMsg;
         e->errorMessage(eMsg);
-        ERRLOG(eMsg.str()); //log original exception
+        ERRLOG("%s", eMsg.str()); //log original exception
         e->Release();
     }
 
@@ -5482,7 +5482,7 @@ void CWsWorkunitsEx::getInfo(IEspContext &context,const char* wuid0,IEspECLWorku
 
         StringBuffer eMsg;
         e->errorMessage(eMsg);
-        ERRLOG(eMsg.str()); //log original exception
+        ERRLOG("%s", eMsg.str()); //log original exception
         e->Release();
     }
 
@@ -5593,7 +5593,7 @@ void CWsWorkunitsEx::getInfo(IEspContext &context,const char* wuid0,IEspECLWorku
 
         StringBuffer eMsg;
         e->errorMessage(eMsg);
-        ERRLOG(eMsg.str()); //log original exception
+        ERRLOG("%s", eMsg.str()); //log original exception
         e->Release();
     }
 
@@ -5652,7 +5652,7 @@ void CWsWorkunitsEx::getInfo(IEspContext &context,const char* wuid0,IEspECLWorku
 
         StringBuffer eMsg;
         e->errorMessage(eMsg);
-        ERRLOG(eMsg.str()); //log original exception
+        ERRLOG("%s", eMsg.str()); //log original exception
         e->Release();
     }
 
@@ -5744,7 +5744,7 @@ void CWsWorkunitsEx::getInfo(IEspContext &context,const char* wuid0,IEspECLWorku
 
         StringBuffer eMsg;
         e->errorMessage(eMsg);
-        ERRLOG(eMsg.str()); //log original exception
+        ERRLOG("%s", eMsg.str()); //log original exception
         e->Release();
     }
 
@@ -5816,7 +5816,7 @@ void CWsWorkunitsEx::getInfo(IEspContext &context,const char* wuid0,IEspECLWorku
 
          StringBuffer eMsg;
          e->errorMessage(eMsg);
-         ERRLOG(eMsg.str()); //log original exception
+         ERRLOG("%s", eMsg.str()); //log original exception
          e->Release();
      }
 
@@ -5847,7 +5847,7 @@ void CWsWorkunitsEx::getInfo(IEspContext &context,const char* wuid0,IEspECLWorku
 
         StringBuffer eMsg;
         e->errorMessage(eMsg);
-        ERRLOG(eMsg.str()); //log original exception
+        ERRLOG("%s", eMsg.str()); //log original exception
         e->Release();
     }
 
@@ -5880,7 +5880,7 @@ void CWsWorkunitsEx::getInfo(IEspContext &context,const char* wuid0,IEspECLWorku
 
         StringBuffer eMsg;
         e->errorMessage(eMsg);
-        ERRLOG(eMsg.str()); //log original exception
+        ERRLOG("%s", eMsg.str()); //log original exception
         e->Release();
     }
 
@@ -9069,7 +9069,7 @@ bool CWsWorkunitsEx::onWUClusterJobQueueXLS(IEspContext &context, IEspWUClusterJ
 
             StringBuffer msg;
             msg.appendf("ESP Access Denied: User %s does not have rights to access any workunits.", context.queryUserId());
-            throw MakeStringException(ECLWATCH_ECL_WU_ACCESS_DENIED, msg.str());
+            throw MakeStringException(ECLWATCH_ECL_WU_ACCESS_DENIED, "%s", msg.str());
         }
 
         MemoryBuffer text;
@@ -9139,7 +9139,7 @@ bool CWsWorkunitsEx::onWUClusterJobQueueLOG(IEspContext &context,IEspWUClusterJo
 
             StringBuffer msg;
             msg.appendf("ESP Access Denied: User %s does not have rights to access any workunits.", context.queryUserId());
-            throw MakeStringException(ECLWATCH_ECL_WU_ACCESS_DENIED, msg.str());
+            throw MakeStringException(ECLWATCH_ECL_WU_ACCESS_DENIED, "%s", msg.str());
         }
 
         const char* cluster = req.getCluster();
@@ -9239,7 +9239,7 @@ bool CWsWorkunitsEx::onWUClusterJobXLS(IEspContext &context, IEspWUClusterJobXLS
 
             StringBuffer msg;
             msg.appendf("ESP Access Denied: User %s does not have rights to access any workunits.", context.queryUserId());
-            throw MakeStringException(ECLWATCH_ECL_WU_ACCESS_DENIED, msg.str());
+            throw MakeStringException(ECLWATCH_ECL_WU_ACCESS_DENIED, "%s", msg.str());
         }
 
         MemoryBuffer text;
@@ -9305,7 +9305,7 @@ bool CWsWorkunitsEx::onWUClusterJobSummaryXLS(IEspContext &context, IEspWUCluste
 
             StringBuffer msg;
             msg.appendf("ESP Access Denied: User %s does not have rights to access any workunits.", context.queryUserId());
-            throw MakeStringException(ECLWATCH_ECL_WU_ACCESS_DENIED, msg.str());
+            throw MakeStringException(ECLWATCH_ECL_WU_ACCESS_DENIED, "%s", msg.str());
         }
 
         MemoryBuffer text;

+ 3 - 3
esp/smc/SMCLib/LogicFileWrapper.cpp

@@ -48,7 +48,7 @@ void LogicFileWrapper::FindClusterName(const char* logicalName, StringBuffer& re
     catch(IException* e){   
       StringBuffer msg;
       e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -81,7 +81,7 @@ bool LogicFileWrapper::doDeleteFile(const char* LogicalFileName,const char *clus
         if (errorStr.length() > 0)
         {
             returnStr.appendf("<Message><Value>%s</Value></Message>",errorStr.str());
-            DBGLOG(errorStr.str());
+            DBGLOG("%s", errorStr.str());
         }
         else {
             PrintLog("Deleted Logical File: %s\n",LogicalFileName);
@@ -124,7 +124,7 @@ bool LogicFileWrapper::doCompressFile(const char* name,StringBuffer& returnStr,
     catch(IException* e){   
       StringBuffer msg;
       e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){

+ 3 - 3
esp/smc/SMCLib/LogicFileWrapper.hpp

@@ -101,7 +101,7 @@ struct DeleteTask: public CInterface, implements ITask
                 {
                     StringBuffer e;
                     e.appendf("Failed to remove file part %s\n",file->queryFilename());
-                    LOG(MCerror, unknownJob, e.str());
+                    LOG(MCerror, unknownJob, "%s", e.str());
                     errs.append(e);
                 }
             }
@@ -118,7 +118,7 @@ struct DeleteTask: public CInterface, implements ITask
             }
         }
         if(errs.length())
-            throw MakeStringException(0,errs.str());
+            throw MakeStringException(0, "%s", errs.str());
 
         return 0;
     }
@@ -147,7 +147,7 @@ struct CompressTask: public CInterface, implements ITask
         {
             StringBuffer err;
             e->errorMessage(err);
-            LOG(MCerror, unknownJob, err.str());
+            LOG(MCerror, unknownJob, "%s", err.str());
             e->Release();
         }
         catch(...)

+ 37 - 37
esp/smc/SMCLib/TpWrapper.cpp

@@ -74,15 +74,15 @@ bool CTpWrapper::getClusterLCR(const char* clusterType, const char* clusterName)
 
     Owned<IEnvironmentFactory> envFactory = getEnvironmentFactory();
     if (!envFactory)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
     
     Owned<IConstEnvironment> constEnv = envFactory->openEnvironmentByFile();
     if (!constEnv)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     Owned<IPropertyTree> root = &constEnv->getPTree();
     if (!root)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     StringBuffer xpath;
     xpath.appendf("Software/%s[@name='%s']", clusterType, clusterName);
@@ -159,7 +159,7 @@ void CTpWrapper::getClusterMachineList(const char* ClusterType,
     catch(IException* e){   
       StringBuffer msg;
       e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -202,7 +202,7 @@ void CTpWrapper::getTpDaliServers(IArrayOf<IConstTpDali>& list)
     Owned<IPropertyTree> root = getEnvironment("Software");
 #endif
     if (!root)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     Owned<IPropertyTreeIterator> services= root->getElements(eqDali);
     ForEach(*services)
@@ -257,7 +257,7 @@ void CTpWrapper::getTpEclServers(IArrayOf<IConstTpEclServer>& list)
     Owned<IPropertyTree> root = getEnvironment("Software");
 #endif
     if (!root)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     Owned<IPropertyTreeIterator> services= root->getElements(eqEclServer);
     ForEach(*services)
@@ -302,7 +302,7 @@ void CTpWrapper::getTpEclCCServers(IArrayOf<IConstTpEclServer>& list, const char
     Owned<IPropertyTree> root = getEnvironment("Software");
 #endif
     if (!root)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     Owned<IPropertyTreeIterator> services= root->getElements(eqEclCCServer);
     ForEach(*services)
@@ -351,7 +351,7 @@ void CTpWrapper::getTpEclAgents(IArrayOf<IConstTpEclAgent>& list, const char* ag
     Owned<IPropertyTree> root = getEnvironment("Software");
 #endif
     if (!root)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     Owned<IPropertyTreeIterator> services= root->getElements(eqEclAgent);
     ForEach(*services)
@@ -395,7 +395,7 @@ void CTpWrapper::getTpEclSchedulers(IArrayOf<IConstTpEclScheduler>& list, const
     DBGLOG("CTpWrapper::getTpEclSchedulers()");
     Owned<IPropertyTree> root = getEnvironment("Software");
     if (!root)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     Owned<IPropertyTreeIterator> services= root->getElements(eqEclScheduler);
     ForEach(*services)
@@ -444,7 +444,7 @@ void CTpWrapper::getTpEspServers(IArrayOf<IConstTpEspServer>& list)
     Owned<IPropertyTree> root = getEnvironment("Software");
 #endif
     if (!root)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     Owned<IPropertyTreeIterator> services= root->getElements(eqEsp);
     ForEach(*services)
@@ -516,7 +516,7 @@ void CTpWrapper::getTpDfuServers(IArrayOf<IConstTpDfuServer>& list)
     Owned<IPropertyTree> root = getEnvironment("Software");
 #endif
     if (!root)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     Owned<IPropertyTreeIterator> services= root->getElements(eqDfu);
     ForEach(*services)
@@ -563,7 +563,7 @@ void CTpWrapper::getTpSashaServers(IArrayOf<IConstTpSashaServer>& list)
     Owned<IPropertyTree> root = getEnvironment("Software");
 #endif
     if (!root)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     Owned<IPropertyTreeIterator> services= root->getElements(eqSashaServer);
     ForEach(*services)
@@ -607,7 +607,7 @@ void CTpWrapper::getTpLdapServers(IArrayOf<IConstTpLdapServer>& list)
     Owned<IPropertyTree> root = getEnvironment("Software");
 #endif
     if (!root)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     Owned<IPropertyTreeIterator> services= root->getElements(eqLdapServer);
     ForEach(*services)
@@ -667,7 +667,7 @@ void CTpWrapper::getTpDropZones(IArrayOf<IConstTpDropZone>& list)
     Owned<IPropertyTree> root = getEnvironment("Software");
 #endif
     if (!root)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     Owned<IEnvironmentFactory> factory = getEnvironmentFactory();
 #if 0
@@ -733,7 +733,7 @@ void CTpWrapper::getTpFTSlaves(IArrayOf<IConstTpFTSlave>& list)
     Owned<IPropertyTree> root = getEnvironment("Software");
 #endif
     if (!root)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     Owned<IPropertyTreeIterator> services= root->getElements(eqFTSlave);
     ForEach(*services)
@@ -766,7 +766,7 @@ void CTpWrapper::getTpDkcSlaves(IArrayOf<IConstTpDkcSlave>& list)
     Owned<IPropertyTree> root = getEnvironment("Software");
 #endif
     if (!root)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     Owned<IPropertyTreeIterator> services= root->getElements(eqDkcSlave);
     ForEach(*services)
@@ -799,7 +799,7 @@ void CTpWrapper::getTpGenesisServers(IArrayOf<IConstTpGenesisServer>& list)
     Owned<IPropertyTree> root = getEnvironment("Software");
 #endif
     if (!root)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     Owned<IPropertyTreeIterator> services= root->getElements(eqGenesisServer);
     ForEach(*services)
@@ -824,7 +824,7 @@ void CTpWrapper::getTargetClusterList(IArrayOf<IEspTpLogicalCluster>& clusters,
     DBGLOG("CTpWrapper::getLogicalClusterList");
     Owned<IPropertyTree> root = getEnvironment("Software");
     if (!root)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     Owned<IPropertyTreeIterator> clusterIterator = root->getElements("Topology/Cluster");
     if (clusterIterator->first()) 
@@ -893,13 +893,13 @@ void CTpWrapper::queryTargetClusterProcess(double version, const char* processNa
     Owned<IConstEnvironment> constEnv = envFactory->openEnvironmentByFile();
     Owned<IPropertyTree> root = &constEnv->getPTree();
     if (!root)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     StringBuffer xpath;
     xpath.appendf("Software/%s[@name='%s']", clusterType, processName);
     IPropertyTree* pClusterTree = root->queryPropTree(xpath.str());
     if (!pClusterTree)
-        throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+        throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
     const char* queueName = NULL;
     if (processName&&(stricmp(clusterType,eqThorCluster)==0)) 
@@ -1027,7 +1027,7 @@ void CTpWrapper::queryTargetClusters(double version, const char* clusterType, co
         Owned<IConstEnvironment> constEnv = envFactory->openEnvironmentByFile();
         Owned<IPropertyTree> root = &constEnv->getPTree();
         if (!root)
-            throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+            throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
         Owned<IPropertyTreeIterator> clusters= root->getElements("Software/Topology/Cluster");
         if (!clusters->first())
@@ -1135,7 +1135,7 @@ void CTpWrapper::queryTargetClusters(double version, const char* clusterType, co
     catch(IException* e){   
         StringBuffer msg;
         e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -1164,7 +1164,7 @@ void CTpWrapper::getClusterProcessList(const char* ClusterType, IArrayOf<IEspTpC
             IPropertyTree* pSoftware = root->queryPropTree("Software");
 #endif
             if (!pSoftware)
-                throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+                throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
             StringArray queuesdone;
             StringArray groupsdone;
@@ -1311,7 +1311,7 @@ void CTpWrapper::getClusterProcessList(const char* ClusterType, IArrayOf<IEspTpC
     catch(IException* e){   
         StringBuffer msg;
         e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -1419,7 +1419,7 @@ void CTpWrapper::getHthorClusterList(IArrayOf<IEspTpCluster>& clusterList)
     catch(IException* e){   
         StringBuffer msg;
         e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -1447,7 +1447,7 @@ void CTpWrapper::getGroupList(IArrayOf<IEspTpGroup> &GroupList)
     catch(IException* e){   
       StringBuffer msg;
       e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -1486,7 +1486,7 @@ void CTpWrapper::resolveGroupInfo(const char* groupName,StringBuffer& Cluster, S
 #else
         Owned<IPropertyTree> pTopology = getEnvironment("Software/Topology");
         if (!pTopology)
-            throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+            throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
         Owned<IPropertyTreeIterator> nodes=  pTopology->getElements("//Cluster");
         if (nodes->first()) 
@@ -1509,7 +1509,7 @@ void CTpWrapper::resolveGroupInfo(const char* groupName,StringBuffer& Cluster, S
     catch(IException* e){   
       StringBuffer msg;
       e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -1523,7 +1523,7 @@ StringBuffer& CTpWrapper::getPrefixName(const char* clusterName,StringBuffer& pr
     {
         Owned<IConstWUClusterInfo> clusterInfo = getTargetClusterInfo(clusterName);
         if (!clusterInfo)
-            throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+            throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
         StringBufferAdaptor adaptor(prefixName);
         clusterInfo->getScope(adaptor);
     }
@@ -1531,7 +1531,7 @@ StringBuffer& CTpWrapper::getPrefixName(const char* clusterName,StringBuffer& pr
     {
         StringBuffer msg;
         e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...)
@@ -1587,7 +1587,7 @@ void CTpWrapper::getMachineList(const char* MachineType,
         Owned<IConstEnvironment> constEnv = envFactory->openEnvironmentByFile();
         Owned<IPropertyTree> root0 = &constEnv->getPTree();
         if (!root0)
-            throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+            throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
     
         char* xpath = (char*)ParentPath;
         if (!strnicmp(xpath, "/Environment/", 13))
@@ -1595,7 +1595,7 @@ void CTpWrapper::getMachineList(const char* MachineType,
 
         IPropertyTree* root = root0->queryPropTree( xpath );
         if (!root)
-            throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+            throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 #endif
         Owned<IPropertyTreeIterator> machines= root->getElements(MachineType);
         const char* nodenametag = getNodeNameTag(MachineType);
@@ -1632,7 +1632,7 @@ void CTpWrapper::getMachineList(const char* MachineType,
     catch(IException* e){   
       StringBuffer msg;
       e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -1664,7 +1664,7 @@ void CTpWrapper::getDropZoneList(const char* MachineType,
         Owned<IConstEnvironment> constEnv = envFactory->openEnvironmentByFile();
         Owned<IPropertyTree> root0 = &constEnv->getPTree();
         if (!root0)
-            throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+            throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
     
         char* xpath = (char*)ParentPath;
         if (!strnicmp(xpath, "/Environment/", 13))
@@ -1672,7 +1672,7 @@ void CTpWrapper::getDropZoneList(const char* MachineType,
 
         IPropertyTree* root = root0->queryPropTree( xpath );
         if (!root)
-            throw MakeStringException(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
+            throw MakeStringExceptionDirect(ECLWATCH_CANNOT_GET_ENV_INFO, MSG_FAILED_GET_ENVIRONMENT_INFO);
 
         Owned<IPropertyTreeIterator> nodes=  root->getElements(eqDropZone);
 #endif
@@ -1697,7 +1697,7 @@ void CTpWrapper::getDropZoneList(const char* MachineType,
     catch(IException* e){   
         StringBuffer msg;
         e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -1771,7 +1771,7 @@ void CTpWrapper::setMachineInfo(const char* name,const char* type,IEspTpMachine&
     catch(IException* e){   
         StringBuffer msg;
         e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){

+ 9 - 9
esp/smc/SMCLib/WUXMLInfo.cpp

@@ -65,7 +65,7 @@ void CWUXMLInfo::buildXmlActiveWuidStatus(const char* ClusterName, IEspECLWorkun
     catch(IException* e){   
       StringBuffer msg;
       e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -105,7 +105,7 @@ bool CWUXMLInfo::buildXmlWuidInfo(IConstWorkUnit &wu, IEspECLWorkunit& wuStructu
     catch(IException* e){   
       StringBuffer msg;
       e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -129,7 +129,7 @@ bool CWUXMLInfo::buildXmlWuidInfo(const char* wuid, IEspECLWorkunit& wuStructure
     catch(IException* e){   
       StringBuffer msg;
       e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -166,7 +166,7 @@ bool CWUXMLInfo::buildXmlWuidInfo(IConstWorkUnit &wu, StringBuffer& wuStructure,
     catch(IException* e){   
       StringBuffer msg;
       e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -200,7 +200,7 @@ bool CWUXMLInfo::buildXmlGraphList(IConstWorkUnit &wu,IPropertyTree& XMLStructur
     catch(IException* e){   
       StringBuffer msg;
       e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -227,7 +227,7 @@ bool CWUXMLInfo::buildXmlExceptionList(IConstWorkUnit &wu,IPropertyTree& XMLStru
     catch(IException* e){   
       StringBuffer msg;
       e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -300,7 +300,7 @@ bool CWUXMLInfo::buildXmlResultList(IConstWorkUnit &wu,IPropertyTree& XMLStructu
     catch(IException* e){   
       StringBuffer msg;
       e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -336,7 +336,7 @@ bool CWUXMLInfo::buildXmlTimimgList(IConstWorkUnit &wu,IPropertyTree& XMLStructu
     catch(IException* e){   
       StringBuffer msg;
       e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){
@@ -382,7 +382,7 @@ bool CWUXMLInfo::buildXmlLogList(IConstWorkUnit &wu,IPropertyTree& XMLStructure)
     catch(IException* e){   
       StringBuffer msg;
       e->errorMessage(msg);
-        WARNLOG(msg.str());
+        WARNLOG("%s", msg.str());
         e->Release();
     }
     catch(...){

+ 1 - 1
esp/smc/SMCLib/exception_util.hpp

@@ -153,7 +153,7 @@ inline void FORWARDEXCEPTION(IException *e, unsigned codeNew)
     {
         StringBuffer eMsg_Display;
         eMsg_Display.appendf("%s: %s", timeStamp, eMsg.str());
-        throw MakeStringException(err, eMsg_Display.str());
+        throw MakeStringException(err, "%s", eMsg_Display.str());
     }
         
     return;

+ 8 - 8
plugins/fileservices/fileservices.cpp

@@ -555,7 +555,7 @@ void blockUntilComplete(const char * label, IClientFileSpray &server, ICodeConte
         {
             StringBuffer errmsg;
             excep->errorMessage(errmsg);
-            throw MakeStringException(0, errmsg.str());
+            throw MakeStringException(0, "%s", errmsg.str());
         }
 
         IConstDFUWorkunit & dfuwu = result->getResult();
@@ -677,7 +677,7 @@ FILESERVICES_API char * FILESERVICES_CALL fsfSprayFixed(ICodeContext *ctx, const
         {
             StringBuffer errmsg;
             excep->errorMessage(errmsg);
-            throw MakeStringException(0, errmsg.str());
+            throw MakeStringException(0, "%s", errmsg.str());
         }
         else
         {
@@ -731,7 +731,7 @@ FILESERVICES_API char * FILESERVICES_CALL fsfSprayVariable(ICodeContext *ctx, co
         {
             StringBuffer errmsg;
             excep->errorMessage(errmsg);
-            throw MakeStringException(0, errmsg.str());
+            throw MakeStringException(0, "%s", errmsg.str());
         }
         else
         {
@@ -789,7 +789,7 @@ FILESERVICES_API char * FILESERVICES_CALL fsfSprayXml(ICodeContext *ctx, const c
         {
             StringBuffer errmsg;
             excep->errorMessage(errmsg);
-            throw MakeStringException(0, errmsg.str());
+            throw MakeStringException(0, "%s", errmsg.str());
         }
         else
         {
@@ -835,7 +835,7 @@ FILESERVICES_API char * FILESERVICES_CALL fsfDespray(ICodeContext *ctx, const ch
         {
             StringBuffer errmsg;
             excep->errorMessage(errmsg);
-            throw MakeStringException(0, errmsg.str());
+            throw MakeStringException(0, "%s", errmsg.str());
         }
         else
         {
@@ -895,7 +895,7 @@ FILESERVICES_API char * FILESERVICES_CALL fsfCopy(ICodeContext *ctx, const char
         {
             StringBuffer errmsg;
             excep->errorMessage(errmsg);
-            throw MakeStringException(0, errmsg.str());
+            throw MakeStringException(0, "%s", errmsg.str());
         }
         else
         {
@@ -938,7 +938,7 @@ FILESERVICES_API char * FILESERVICES_CALL fsfReplicate(ICodeContext *ctx, const
         {
             StringBuffer errmsg;
             excep->errorMessage(errmsg);
-            throw MakeStringException(0, errmsg.str());
+            throw MakeStringException(0, "%s", errmsg.str());
         }
         else
         {
@@ -1730,7 +1730,7 @@ FILESERVICES_API char * FILESERVICES_CALL fsfRemotePull(ICodeContext *ctx,
         {
             StringBuffer errmsg;
             excep->errorMessage(errmsg);
-            throw MakeStringException(0, errmsg.str());
+            throw MakeStringException(0, "%s", errmsg.str());
         }
         else
         {

+ 2 - 2
roxie/ccd/ccdfile.cpp

@@ -678,7 +678,7 @@ class CRoxieFileCache : public CInterface, implements ICopyFileProgress, impleme
         {
             StringBuffer err;
             err.appendf("Insufficient disk space.  File %s needs %"I64F"d bytes, but only %"I64F"d remains, and %"I64F"d is needed as a reserve", targetFilename, targetFile->size(), freeDiskSpace, minFreeDiskSpace   );
-            IException *E = MakeStringException(ROXIE_DISKSPACE_ERROR, err.str());
+            IException *E = MakeStringException(ROXIE_DISKSPACE_ERROR, "%s", err.str());
             EXCLOG(MCoperatorError, E);
             E->Release();
         }
@@ -777,7 +777,7 @@ class CRoxieFileCache : public CInterface, implements ICopyFileProgress, impleme
         {
             StringBuffer err;
             err.appendf("Insufficient disk space.  File %s needs %"I64F"d bytes, but only %"I64F"d remains, and %"I64F"d is needed as a reserve", targetFilename, sourceFile->size(), freeDiskSpace, minFreeDiskSpace);
-            IException *E = MakeStringException(ROXIE_DISKSPACE_ERROR, err.str());
+            IException *E = MakeStringException(ROXIE_DISKSPACE_ERROR, "%s", err.str());
             EXCLOG(MCoperatorError, E);
             E->Release();
         }

+ 1 - 1
roxie/ccd/ccdmain.cpp

@@ -357,7 +357,7 @@ void FatalError(const char *format, ...)
     StringBuffer errMsg;
     errMsg.valist_appendf(format, args);
     va_end(args);
-    Owned<IException> E = MakeStringException(MSGAUD_operator, ROXIE_INTERNAL_ERROR, errMsg.str());
+    Owned<IException> E = MakeStringException(MSGAUD_operator, ROXIE_INTERNAL_ERROR, "%s", errMsg.str());
     EXCLOG(E, "Fatal error");
     Sleep(5000);
     _exit(1);

+ 1 - 1
roxie/ccd/ccdquery.cpp

@@ -1489,6 +1489,6 @@ IRecordLayoutTranslator * createRecordLayoutTranslator(const char *logicalName,
         E->errorMessage(m);
         E->Release();
         DBGLOG("%s", m.str());
-        throw MakeStringException(ROXIE_RCD_LAYOUT_TRANSLATOR, m.str());
+        throw MakeStringException(ROXIE_RCD_LAYOUT_TRANSLATOR, "%s", m.str());
     }
 }

+ 5 - 5
roxie/ccd/ccdserver.cpp

@@ -2652,7 +2652,7 @@ void throwRemoteException(IMessageUnpackCursor *extra)
         const char *msg = p->queryProp("Message");
         if (!msg)
             msg = xml;
-        throw MakeStringException(code, msg);
+        throw MakeStringException(code, "%s", msg);
     }
     throwUnexpected();
 }
@@ -30015,8 +30015,8 @@ public:
                     {
                         StringBuffer err;
                         err.appendf("doControlQuery::do (%d of %d): %.80s received invalid response %s", i, numChildren, queryText, childReply.str());
-                        logctx.CTXLOG(err.str());
-                        throw MakeStringException(ROXIE_INTERNAL_ERROR, err.str());
+                        logctx.CTXLOG("%s", err.str());
+                        throw MakeStringException(ROXIE_INTERNAL_ERROR, "%s", err.str());
                     }
                     Owned<IPropertyTreeIterator> meat = xml->getElements("Endpoint");
                     ForEach(*meat)
@@ -30511,8 +30511,8 @@ public:
         }
         else
         {
-            IException *E = MakeStringException(ROXIE_TOO_MANY_QUERIES, err.str());
-            logctx.logOperatorException(E, __FILE__, __LINE__, message.str());
+            IException *E = MakeStringException(ROXIE_TOO_MANY_QUERIES, "%s", err.str());
+            logctx.logOperatorException(E, __FILE__, __LINE__, "%s", message.str());
             E->Release();
         }
 

+ 3 - 3
system/jhtree/jhtree.cpp

@@ -115,7 +115,7 @@ void SegMonitorList::checkSize(size32_t keyedSize, char const * keyname)
     {
         StringBuffer err;
         err.appendf("Key size mismatch on key %s - size was %u, expected %u", keyname, getSize(), keyedSize);
-        IException *e = MakeStringException(1000, err.str());
+        IException *e = MakeStringException(1000, "%s", err.str());
         EXCLOG(e, err.str());
         throw e;
     }
@@ -606,7 +606,7 @@ public:
             {
                 StringBuffer err;
                 err.appendf("Key size mismatch - key file (%s) indicates record size should be %d, but ECL declaration was %d", keyName.get(), keySize, eclKeySize);
-                IException *e = MakeStringException(1000, err.str());
+                IException *e = MakeStringException(1000, "%s", err.str());
                 EXCLOG(e, err.str());
                 throw e;
             }
@@ -944,7 +944,7 @@ public:
                 StringBuffer err;
                 err.append("Could not translate index read filters during layout translation of index ").append(keyName.get()).append(": ");
                 layoutTrans->queryFailure().getDetail(err);
-                throw MakeStringException(0, err.str());
+                throw MakeStringException(0, "%s", err.str());
             }
         }
         segs.finish();

+ 2 - 2
system/jlib/jbroadcast.cpp

@@ -996,8 +996,8 @@ public:
                     pollStr.append(" ALL (mcast) nodes");
                     mcastSock->write(header, sizeof(MCPacketHeader));
                 }
-                LOG(MCdebugProgress(30), unknownJob, pollStr.str());
-                LOG(MCdebugProgress(40), unknownJob, ackStr.str());
+                LOG(MCdebugProgress(30), unknownJob, "%s", pollStr.str());
+                LOG(MCdebugProgress(40), unknownJob, "%s", ackStr.str());
                 lastPoll = msTick();
             }
             else

+ 4 - 4
system/jlib/jexcept.cpp

@@ -329,7 +329,7 @@ public:
                 StringBuffer msg;
                 msg.appendf("[%s] ",source);
                 e.errorMessage(msg);
-                array_.append(*MakeStringException(e.errorAudience(), e.errorCode(), msg));
+                array_.append(*MakeStringException(e.errorAudience(), e.errorCode(), "%s", msg.str()));
             }
             else
                 array_.append(*LINK(&e));
@@ -510,7 +510,7 @@ void RaiseAssertException(const char *assertion, const char *file, unsigned line
 #endif
 #endif
 
-    throw MakeStringException(3000,s.toCharArray()); // 3000: internal error
+    throw MakeStringException(3000, "%s", s.toCharArray()); // 3000: internal error
 }
 
 void RaiseAssertCore(const char *assertion, const char *file, unsigned line)
@@ -1171,7 +1171,7 @@ IException * deserializeException(MemoryBuffer & in)
     StringAttr text;
     in.read(code);
     in.read(text);
-    return MakeStringException(code, text);
+    return MakeStringException(code, "%s", text.get());
 }
 
 void jlib_decl serializeException(IException * e, MemoryBuffer & out)
@@ -1269,7 +1269,7 @@ void SignalToException::processSetJmpResult(int res)
             break;
         }
         buf.append(" as exception");
-        throw MakeStringException(res, buf.toCharArray());
+        throw MakeStringException(res, "%s", buf.toCharArray());
     }
 }
 

+ 2 - 2
system/jlib/jfile.cpp

@@ -853,7 +853,7 @@ void CFile::copySection(const RemoteFilename &dest, offset_t toOfs, offset_t fro
         StringBuffer s;
         s.append("copyFile target=").append(target->queryFilename()).append(" source=").append(queryFilename()).append("; read/write failure").append(": ");
         e->errorMessage(s);
-        IException *e2 = MakeOsException(e->errorCode(), s.str());
+        IException *e2 = MakeOsException(e->errorCode(), "%s", s.str());
         e->Release();
         throw e2;
     }
@@ -2778,7 +2778,7 @@ void doCopyFile(IFile * target, IFile * source, size32_t buffersize, ICopyFilePr
         // try to delete partial copy
         StringBuffer s;
         s.append("copyFile target=").append(dest->queryFilename()).append(" source=").append(source->queryFilename()).appendf("; read/write failure (%d): ",e->errorCode());
-        exc.setown(MakeStringException(e->errorCode(), s.str()));
+        exc.setown(MakeStringException(e->errorCode(), "%s", s.str()));
         e->Release();
         EXCLOG(exc, "doCopyFile");
     }

+ 2 - 2
system/jlib/jlog.cpp

@@ -1091,7 +1091,7 @@ void LogMsgComponentReporter::report(const LogMsgCategory & cat, const IExceptio
     StringBuffer buff;
     if(prefix) buff.append(prefix).append(" : ");
     exception->errorMessage(buff);
-    queryLogMsgManager()->report(component, cat, unknownJob, exception->errorCode(), buff.str());
+    queryLogMsgManager()->report(component, cat, unknownJob, exception->errorCode(), "%s", buff.str());
 }
 
 void LogMsgComponentReporter::report(const LogMsgCategory & cat, const LogMsgJobInfo & job, const char * format, ...)
@@ -1125,7 +1125,7 @@ void LogMsgComponentReporter::report(const LogMsgCategory & cat, const LogMsgJob
     StringBuffer buff;
     if(prefix) buff.append(prefix).append(" : ");
     exception->errorMessage(buff);
-    queryLogMsgManager()->report(component, cat, job, exception->errorCode(), buff.str());
+    queryLogMsgManager()->report(component, cat, job, exception->errorCode(), "%s", buff.str());
 }
 
 void LogMsgComponentReporter::report(const LogMsg & msg)

+ 2 - 2
system/jlib/jmisc.cpp

@@ -229,7 +229,7 @@ jlib_decl void appendLogFile(const char *filename, unsigned detail, bool enterQu
 
 jlib_decl void PrintLogDirect(const char *msg)
 {
-    LOG(MClegacy, unknownJob, msg);
+    LOG(MClegacy, unknownJob, "%s", msg);
 }
 
 jlib_decl int PrintLog(const char *fmt, ...)
@@ -592,7 +592,7 @@ bool invoke_program(const char *command_line, DWORD &runcode, bool wait, const c
 
         ERRLOG("%s",s.toCharArray());
         if(throwException)
-            throw MakeStringException(-1, s.str());
+            throw MakeStringException(-1, "%s", s.str());
         return false;
     }
 

+ 2 - 2
system/security/LdapSecurity/ldapconnection.cpp

@@ -2431,7 +2431,7 @@ public:
             if(rc == LDAP_UNWILLING_TO_PERFORM)
                 errmsg.append(" The ldap server refused to execute the password change action, one of the reasons might be that the new password you entered doesn't satisfy the policy requirement.");
 
-            throw MakeStringException(-1, errmsg.str());
+            throw MakeStringException(-1, "%s", errmsg.str());
         }
 
         return true;
@@ -2584,7 +2584,7 @@ public:
                 if(rc == LDAP_UNWILLING_TO_PERFORM)
                     errmsg.append(" The ldap server refused to execute the password change action, one of the reasons might be that the new password you entered doesn't satisfy the policy requirement.");
 
-                throw MakeStringException(-1, errmsg.str());
+                throw MakeStringException(-1, "%s", errmsg.str());
             }
         }
         return true;

+ 2 - 4
system/security/securesocket/securesocket.cpp

@@ -67,10 +67,8 @@ bool accept_selfsigned = false;
 #define CHK_SSL(err) if((err) ==-1){ERR_print_errors_fp(stderr); exit(2);}
 
 #define THROWSECURESOCKETEXCEPTION(err) \
-  { \
-    char msg[1024]; \
-    sprintf(msg,"SecureSocket Exception Raised in: %s, line %d - %s",__FILE__, __LINE__, err); \
-    throw MakeStringException(-1, msg); }
+    throw MakeStringException(-1, "SecureSocket Exception Raised in: %s, line %d - %s", __FILE__, __LINE__, err);
+
 
 int pem_passwd_cb(char* buf, int size, int rwflag, void* password)
 {

+ 20 - 20
system/xmllib/xslprocessor.cpp

@@ -370,16 +370,16 @@ int CXslTransform::transform(StringBuffer &target)
     {
         StringBuffer estr("[Exception running XSLT stylesheet]");
         estr.appendf("[%s]", m_XalanTransformer.getLastError());
-        DBGLOG(estr.str());
-        throw MakeStringException(2, estr.str());
+        DBGLOG("%s", estr.str());
+        throw MakeStringException(2, "%s", estr.str());
     }
 
     if (rc < 0)
     {
         StringBuffer estr;
         estr.appendf("[%s]", m_XalanTransformer.getLastError());
-        DBGLOG(estr.str());
-        throw MakeStringException(2, estr.str());
+        DBGLOG("%s", estr.str());
+        throw MakeStringException(2, "%s", estr.str());
     }
 
     return rc;
@@ -414,15 +414,15 @@ int CXslTransform::transform()
     {
         StringBuffer estr("[Exception running XSLT stylesheet]");
         estr.appendf("[%s]", m_XalanTransformer.getLastError());
-        DBGLOG(estr.str());
-        throw MakeStringException(2, estr.str());
+        DBGLOG("%s", estr.str());
+        throw MakeStringException(2, "%s", estr.str());
     }
     if (rc < 0)
     {
         StringBuffer estr;
         estr.appendf("[%s]", m_XalanTransformer.getLastError());
-        DBGLOG(estr.str());
-        throw MakeStringException(2, estr.str());
+        DBGLOG("%s", estr.str());
+        throw MakeStringException(2, "%s", estr.str());
     }
 
     return rc;
@@ -458,15 +458,15 @@ int CXslTransform::transform(ISocket* targetSocket)
     {
         StringBuffer estr("[Exception running XSLT stylesheet]");
         estr.appendf("[%s]", m_XalanTransformer.getLastError());
-        DBGLOG(estr.str());
-        throw MakeStringException(2, estr.str());
+        DBGLOG("%s", estr.str());
+        throw MakeStringException(2, "%s", estr.str());
     }
     if (rc < 0)
     {
         StringBuffer estr;
         estr.appendf("[%s]", m_XalanTransformer.getLastError());
-        DBGLOG(estr.str());
-        throw MakeStringException(2, estr.str());
+        DBGLOG("%s", estr.str());
+        throw MakeStringException(2, "%s", estr.str());
     }
 
     return rc;
@@ -494,16 +494,16 @@ int CXslTransform::setXmlSource(const char *pszFileName)
         m_ParsedSource = NULL;
         StringBuffer estr("[Exception compiling xml]");
         estr.appendf("[%s]", m_XalanTransformer.getLastError());
-        DBGLOG(estr.str());
-        throw MakeStringException(2, estr.str());
+        DBGLOG("%s", estr.str());
+        throw MakeStringException(2, "%s", estr.str());
     }
 
     if (!m_ParsedSource)
     {
         StringBuffer estr("[failed to compile xml]");
         estr.appendf("[%s]", m_XalanTransformer.getLastError());
-        DBGLOG(estr.str());
-        throw MakeStringException(2, estr.str());
+        DBGLOG("%s", estr.str());
+        throw MakeStringException(2, "%s", estr.str());
     }
 
     return theResult;
@@ -530,16 +530,16 @@ int CXslTransform::setXmlSource(const char *pszBuffer, unsigned int nSize)
         m_ParsedSource = NULL;
         StringBuffer estr("[Exception compiling xml]");
         estr.appendf("[%s]", m_XalanTransformer.getLastError());
-        DBGLOG(estr.str());
-        throw MakeStringException(2, estr.str());
+        DBGLOG("%s", estr.str());
+        throw MakeStringException(2, "%s", estr.str());
     }
 
     if (!m_ParsedSource)
     {
         StringBuffer estr("[failed to compile xml]");
         estr.appendf("[%s]", m_XalanTransformer.getLastError());
-        DBGLOG(estr.str());
-        throw MakeStringException(2, estr.str());
+        DBGLOG("%s", estr.str());
+        throw MakeStringException(2, "%s", estr.str());
     }
 
     return theResult;

+ 4 - 4
system/xmllib/xslprocessor.ipp

@@ -262,16 +262,16 @@ public:
                 m_CompiledStylesheet = NULL;
                 StringBuffer estr("[Exception compiling XSLT stylesheet]");
                 estr.appendf("[%s]", m_XalanTransformer.getLastError());
-                DBGLOG(estr.str());
-                throw MakeStringException(2, estr.str());
+                DBGLOG("%s", estr.str());
+                throw MakeStringException(2, "%s", estr.str());
             }
 
             if (!m_CompiledStylesheet)
             {
                 StringBuffer estr("[failed to compile XSLT stylesheet]");
                 estr.appendf("[%s]", m_XalanTransformer.getLastError());
-                DBGLOG(estr.str());
-                throw MakeStringException(2, estr.str());
+                DBGLOG("%s", estr.str());
+                throw MakeStringException(2, "%s", estr.str());
             }
 
         }

+ 1 - 1
thorlcr/activities/choosesets/thchoosesetsslave.cpp

@@ -398,7 +398,7 @@ class ChooseSetsLastActivity : public ChooseSetsPlusActivity
                 numToReturn[idx] = (unsigned)(priorCounts[idx] + counts[idx] - firstToCopy);
                 skipAll = false;
 #if THOR_TRACE_LEVEL >= 5
-                ActPrintLog("CHOOSESETSLAST: Selection %d.  Range(%d,%d)", idx, numToSkip[idx], counts[idx]);
+                ActPrintLog("CHOOSESETSLAST: Selection %d.  Range(%d,%"RCPF"d)", idx, numToSkip[idx], counts[idx]);
 #endif
             }
         }

+ 2 - 2
thorlcr/activities/diskread/thdiskreadslave.cpp

@@ -306,7 +306,7 @@ public:
                     StringBuffer s;
                     e->errorMessage(s);
                     s.append(" - handling file: ").append(filename.get());
-                    IException *e2 = MakeActivityException(&activity, e, s.str());
+                    IException *e2 = MakeActivityException(&activity, e, "%s", s.str());
                     e->Release();
                     throw e2;
                 }
@@ -660,7 +660,7 @@ public:
                 StringBuffer s;
                 e->errorMessage(s);
                 s.append(" - handling file: ").append(filename.get());
-                IException *e2 = MakeActivityException(&activity, e, s.str());
+                IException *e2 = MakeActivityException(&activity, e, "%s", s.str());
                 e->Release();
                 eoi = true;
                 throw e2;

+ 2 - 2
thorlcr/activities/hashdistrib/thhashdistribslave.cpp

@@ -2515,7 +2515,7 @@ CThorRowAggregator *mergeLocalAggs(CActivityBase &activity, IHThorRowAggregator
 
     activity.ActPrintLog("HASHAGGREGATE: Read %"RCPF"d records to build hash table", readCount);
     StringBuffer str("HASHAGGREGATE: After distribution merge contains ");
-    activity.ActPrintLog(str.append(globalAggTable->elementCount()).append("entries").str());
+    activity.ActPrintLog("%s", str.append(globalAggTable->elementCount()).append("entries").str());
     return globalAggTable.getClear();
 }
 
@@ -2567,7 +2567,7 @@ public:
                 localAggTable->addRow(row);
             }
             StringBuffer str("HASHAGGREGATE: Table before distribution contains ");
-            ActPrintLog(str.append(localAggTable->elementCount()).append(" entries").str());
+            ActPrintLog("%s", str.append(localAggTable->elementCount()).append(" entries").str());
         }
         catch (IException *)
         {

+ 1 - 1
thorlcr/activities/lookupjoin/thlookupjoinslave.cpp

@@ -1034,7 +1034,7 @@ public:
             errStr.append(exception->errorCode()).append(", ");
             exception->errorMessage(errStr);
             errStr.append(")");
-            IException *e2 = MakeActivityException(this, TE_TooMuchData, errStr.str());
+            IException *e2 = MakeActivityException(this, TE_TooMuchData, "%s", errStr.str());
             ActPrintLog(e2, NULL);
             throw e2;
         }

+ 2 - 2
thorlcr/activities/msort/thgroupsortslave.cpp

@@ -105,7 +105,7 @@ public:
                         StringBuffer errStr("GROUPSORT");
                         errStr.append("(").append(container.queryId()).append(") ");
                         errStr.append("exceeded available memory. records=").append(group.ordinality()).append(", memory usage=").append((unsigned)(group.totalSize()/1024)).append('k');
-                        IException *e = MakeActivityException(this, TE_TooMuchData, errStr.str());
+                        IException *e = MakeActivityException(this, TE_TooMuchData, "%s", errStr.str());
                         EXCLOG(e, NULL);
                         throw e;
                     }
@@ -124,7 +124,7 @@ public:
                 errStr.append(": ").append(e->errorCode()).append(", ");
                 e->errorMessage(errStr);
                 e->Release();
-                IException *e2 = MakeActivityException(this, TE_TooMuchData, errStr.str());
+                IException *e2 = MakeActivityException(this, TE_TooMuchData, "%s", errStr.str());
                 EXCLOG(e2, NULL);
                 throw e2;
             }

+ 3 - 3
thorlcr/activities/thactivityutil.cpp

@@ -724,7 +724,7 @@ void doReplicate(CActivityBase *activity, IPartDescriptor &partDesc, ICopyFilePr
     }
     catch (IException *e)
     {
-        Owned<IThorException> e2 = MakeActivityWarning(activity, e, "");
+        Owned<IThorException> e2 = MakeActivityWarning(activity, e, "doReplicate");
         e->Release();
         activity->fireException(e2);
     }
@@ -863,7 +863,7 @@ IFileIO *createMultipleWrite(CActivityBase *activity, IPartDescriptor &partDesc,
         if (!fileio)
         {
             compress = false;
-            Owned<IThorException> e = MakeActivityWarning(activity, TE_LargeBufferWarning, "Could not write file '%s' compressed");
+            Owned<IThorException> e = MakeActivityWarning(activity, TE_LargeBufferWarning, "Could not write file '%s' compressed", outLocationName.str());
             activity->fireException(e);
             fileio.setown(file->open(extend&&file->exists()?IFOwrite:IFOcreate)); 
         }
@@ -970,7 +970,7 @@ void CThorRowAggregator::checkMem()
     {
         StringBuffer errMsg("Large Group Aggregate table, memory usage=");
         errMsg.append((unsigned __int64)queryMem());
-        Owned<IThorException> e = MakeActivityException(&activity, TE_LargeAggregateTable, errMsg.str());
+        Owned<IThorException> e = MakeActivityException(&activity, TE_LargeAggregateTable, "%s", errMsg.str());
         EXCLOG(e, NULL);
         if (grow && (ThorRowMemoryAvailable()-(queryLargeMemSize()/10) > queryLargeMemSize()/8)) // if plenty left warn but let it grow
         {

+ 1 - 1
thorlcr/activities/topn/thtopnslave.cpp

@@ -207,7 +207,7 @@ public:
                             break; // never reading from node 0 (0 == terminator)
                         StringBuffer s;
                         s.appendN(indent, ' ').append("Merging from node: ").append(node);
-                        ActPrintLog(s.str());
+                        ActPrintLog("%s", s.str());
                         streams.append(*createRowStreamFromNode(*this, node+1, container.queryJob().queryJobComm(), mpTag, abortSoon));
                     }
                     Owned<IRowLinkCounter> linkcounter = new CThorRowLinkCounter;

+ 1 - 1
thorlcr/activities/wuidwrite/thwuidwrite.cpp

@@ -125,7 +125,7 @@ public:
                     else
                         errMsg.append("sequence=").append(helper->getSequence());
                     errMsg.append(")");
-                    throw MakeThorException(TE_WorkUnitWriteLimitExceeded, errMsg.str());
+                    throw MakeThorException(TE_WorkUnitWriteLimitExceeded, "%s", errMsg.str());
                 }
                 resultData.append(l, mb.readDirect(l));
                 mb.clear();

+ 2 - 2
thorlcr/activities/xmlparse/thxmlparseslave.cpp

@@ -145,7 +145,7 @@ public:
             s.append("INTERNAL ERROR ").append(e->errorCode()).append(": ");
             e->errorMessage(s);
             e->Release();
-            throw MakeActivityException(this, 0, s.str());
+            throw MakeActivityException(this, 0, "%s", s.str());
         }
         catch (IException *e)
         {
@@ -154,7 +154,7 @@ public:
             s.append(") INTERNAL ERROR ").append(e->errorCode()).append(": ");
             e->errorMessage(s);
             e->Release();
-            throw MakeActivityException(this, 0, s.str());
+            throw MakeActivityException(this, 0, "%s", s.str());
         }
         eogNext = false;
         anyThisGroup = false;

+ 2 - 2
thorlcr/activities/xmlread/thxmlreadslave.cpp

@@ -134,7 +134,7 @@ class CXmlReadSlaveActivity : public CDiskReadSlaveActivityBase, public CThorDat
                 StringBuffer s("XMLRead actId(");
                 s.append(activity.queryContainer().queryId()).append(") out of memory.").newline();
                 s.append("INTERNAL ERROR ").append(e->errorCode());
-                Owned<IException> e2 = MakeActivityException(&activity, e, s.str());
+                Owned<IException> e2 = MakeActivityException(&activity, e, "%s", s.str());
                 e->Release();
                 throw e2.getClear();
             }
@@ -143,7 +143,7 @@ class CXmlReadSlaveActivity : public CDiskReadSlaveActivityBase, public CThorDat
                 StringBuffer s("XMLRead actId(");
                 s.append(activity.queryContainer().queryId());
                 s.append(") INTERNAL ERROR ").append(e->errorCode());
-                Owned<IException> e2 = MakeActivityException(&activity, e, s.str());
+                Owned<IException> e2 = MakeActivityException(&activity, e, "%s", s.str());
                 e->Release();
                 throw e2.getClear();
             }

+ 3 - 3
thorlcr/graph/thgraph.cpp

@@ -1341,7 +1341,7 @@ void CGraphBase::doExecute(size32_t parentExtractSz, const byte *parentExtract,
         if (exception && !queryOwner())
         {
             StringBuffer str;
-            Owned<IThorException> e = MakeThorException(exception->errorCode(), exception->errorMessage(str).str());
+            Owned<IThorException> e = MakeThorException(exception->errorCode(), "%s", exception->errorMessage(str).str());
             e->setGraphId(graphId);
             e->setAction(tea_abort);
             fireException(e);
@@ -2341,7 +2341,7 @@ public:
                         if (r != running.ordinality()-1)
                             str.append(", ");
                     }
-                    PROGLOG(str.str());
+                    PROGLOG("%s", str.str());
                 }
                 if (stack.ordinality())
                 {
@@ -2353,7 +2353,7 @@ public:
                         if (s != stack.ordinality()-1)
                             str.append(", ");
                     }
-                    PROGLOG(str.str());
+                    PROGLOG("%s", str.str());
                 }
             }
         }

+ 6 - 6
thorlcr/graph/thgraph.hpp

@@ -243,8 +243,8 @@ public:
     void releaseIOs();
     void addDependsOn(CGraphBase *graph, int controlId);
     IThorGraphDependencyIterator *getDependsIterator();
-    void ActPrintLog(const char *format, ...);
-    void ActPrintLog(IException *e, const char *format, ...);
+    void ActPrintLog(const char *format, ...)  __attribute__((format(printf, 2, 3)));
+    void ActPrintLog(IException *e, const char *format, ...) __attribute__((format(printf, 3, 4)));
 
     void setBoundGraph(IThorBoundLoopGraph *graph) { loopGraph.set(graph); }
     IThorBoundLoopGraph *queryLoopGraph() { return loopGraph; }
@@ -668,8 +668,8 @@ public:
     virtual void init() { }
     IThorActivityIterator *getTraverseIterator(bool connected=true);
     IThorActivityIterator *getTraverseIteratorCond();
-    void GraphPrintLog(const char *msg, ...);
-    void GraphPrintLog(IException *e, const char *msg, ...);
+    void GraphPrintLog(const char *msg, ...) __attribute__((format(printf, 2, 3)));
+    void GraphPrintLog(IException *e, const char *msg, ...) __attribute__((format(printf, 3, 4)));
     void createFromXGMML(IPropertyTree *node, CGraphBase *owner, CGraphBase *parent, CGraphBase *resultsGraph);
     const bool &queryAborted() const { return aborted; }
     CJobBase &queryJob() const { return job; }
@@ -1014,8 +1014,8 @@ public:
     virtual MemoryBuffer &queryInitializationData(unsigned slave) const = 0;
     virtual MemoryBuffer &getInitializationData(unsigned slave, MemoryBuffer &mb) const = 0;
 
-    void ActPrintLog(const char *format, ...);
-    void ActPrintLog(IException *e, const char *format, ...);
+    void ActPrintLog(const char *format, ...) __attribute__((format(printf, 2, 3)));
+    void ActPrintLog(IException *e, const char *format, ...) __attribute__((format(printf, 3, 4)));
 
 // IExceptionHandler
     bool fireException(IException *e);

+ 3 - 3
thorlcr/graph/thgraphmaster.cpp

@@ -230,7 +230,7 @@ void CSlaveMessageHandler::main()
                         e->setSlave(sender);
                         StringBuffer tmpStr("Slave ");
                         job.queryJobGroup().queryNode(sender).endpoint().getUrlStr(tmpStr);
-                        GraphPrintLog(graph, e, tmpStr.append(": slave initialization error").str());
+                        GraphPrintLog(graph, e, "%s", tmpStr.append(": slave initialization error").str());
                         throw e.getClear();
                     }
                     break;
@@ -1220,7 +1220,7 @@ void CJobMaster::broadcastToSlaves(CMessageBuffer &msg, mptag_t mptag, unsigned
     {
         // think this should always be fatal, could check link down here, or in general and flag as _shutdown.
         StringBuffer msg("General failure communicating to slaves [");
-        Owned<IThorException> e = MakeThorException(0, msg.append(errorMsg).append("]").str());
+        Owned<IThorException> e = MakeThorException(0, "%s", msg.append(errorMsg).append("]").str());
         e->setAction(tea_shutdown);
         EXCLOG(e, NULL);
         abort(e);
@@ -2036,7 +2036,7 @@ void CMasterGraph::sendActivityInitData()
                 {
                     StringBuffer tmpStr("Slave ");
                     queryJob().queryJobGroup().queryNode(sender).endpoint().getUrlStr(tmpStr);
-                    GraphPrintLog(se, tmpStr.append(": slave initialization error").str());
+                    GraphPrintLog(se, "%s", tmpStr.append(": slave initialization error").str());
                     e.setown(se.getClear());
                 }
                 continue; // to read other slave responses.

+ 5 - 5
thorlcr/graph/thgraphslave.cpp

@@ -772,7 +772,7 @@ public:
     virtual void addWuException(const char * text, unsigned code, unsigned severity)
     {
         DBGLOG("%s", text);
-        Owned<IThorException> e = MakeThorException(code, text);
+        Owned<IThorException> e = MakeThorException(code, "%s", text);
         e->setAction(tea_warning);
         e->setOrigin("user");
         e->setAction(tea_warning);
@@ -814,7 +814,7 @@ public:
     virtual void addWuAssertFailure(unsigned code, const char * text, const char * filename, unsigned lineno, unsigned column, bool isAbort)
     {
         DBGLOG("%s", text);
-        Owned<IThorException> e = MakeThorException(code, text);
+        Owned<IThorException> e = MakeThorException(code, "%s", text);
         e->setAssert(filename, lineno, column);
         e->setOrigin("user");
         e->setSeverity(ExceptionSeverityError);
@@ -922,15 +922,15 @@ void CJobSlave::startJob()
     unsigned __int64 freeSpaceRep = getFreeSpace(queryBaseDirectory(true));
     PROGLOG("Disk space: %s = %"I64F"d, %s = %"I64F"d", queryBaseDirectory(), freeSpace/0x100000, queryBaseDirectory(true), freeSpaceRep/0x100000);
 
-    unsigned __int64 minFreeSpace = getWorkUnitValueInt("MINIMUM_DISK_SPACE", 0);
+    unsigned minFreeSpace = getWorkUnitValueInt("MINIMUM_DISK_SPACE", 0);
     if (minFreeSpace)
     {
-        if (freeSpace < minFreeSpace*0x100000)
+        if (freeSpace < ((unsigned __int64)minFreeSpace)*0x100000)
         {
             SocketEndpoint ep;
             ep.setLocalHost(0);
             StringBuffer s;
-            throw MakeThorException(TE_NotEnoughFreeSpace, "Node %s has %d MB(s) of available disk space, specified minimum for this job: %d MB(s)", ep.getUrlStr(s).str(), (unsigned) freeSpace / 0x100000, minFreeSpace);
+            throw MakeThorException(TE_NotEnoughFreeSpace, "Node %s has %u MB(s) of available disk space, specified minimum for this job: %u MB(s)", ep.getUrlStr(s).str(), (unsigned) freeSpace / 0x100000, minFreeSpace);
         }
     }
     unsigned keyNodeCacheMB = (unsigned)getWorkUnitValueInt("keyNodeCacheMB", 0);

+ 2 - 2
thorlcr/master/thgraphmanager.cpp

@@ -407,7 +407,7 @@ void CJobManager::run()
                                 msg.append("Nothing found on jobq::dequeue");
                             if (e>=5000)
                                 msg.append(" - acceptConversation took ").append(e/1000).append(" secs");
-                            PROGLOG(msg.str());
+                            PROGLOG("%s", msg.str());
                             if (_item.get())
                             {
                                 if (_item->isValidSession())
@@ -591,7 +591,7 @@ void CJobManager::reply(IConstWorkUnit *workunit, const char *wuid, IException *
     s.append(" to agent ");
     agentep.getUrlStr(s);
     s.append(" for workunit(").append(wuid).append(")");
-    PROGLOG(s.str());
+    PROGLOG("%s", s.str());
     MemoryBuffer replyMb;
     workunit->forceReload();
     if (!allDone && (WUActionPause == workunit->getAction() || WUActionPauseNow == workunit->getAction()))

+ 2 - 2
thorlcr/msort/tsortm.cpp

@@ -572,7 +572,7 @@ public:
             else if (cmp>0)
                 ActPrintLog(activity, "ERROR: Min > Max!");
         }
-        ActPrintLog(activity, "Tot = %""d\n",tot);
+        ActPrintLog(activity, "Tot = %"I64F"d", tot);
 #endif
         return tot;
     }
@@ -1377,7 +1377,7 @@ public:
                     CSortNode &slave = slaves.item(i);
                     char url[100];
                     slave.endpoint.getUrlStr(url,sizeof(url));
-                    ActPrintLog(activity, "Split point %d: %d rows on %s",i,tot[i],url);
+                    ActPrintLog(activity, "Split point %d: %"RCPF"d rows on %s", i, tot[i], url);
                 }
                 if (CheckSkewed(threshold,skewWarning,skewError,numnodes,total,max)) {
 #ifdef _TRACE_SKEW_SPLIT

+ 1 - 1
thorlcr/msort/tsortmp.cpp

@@ -80,7 +80,7 @@ bool SortSlaveMP::sendRecv(CMessageBuffer &mb, unsigned timeout)
             mb.read(err);
             StringAttr errstr;
             mb.read(errstr);
-            throw MakeStringException(err,errstr.get());
+            throw MakeStringException(err, "%s", errstr.get());
         }
     }
     throw MakeStringException(-1,"SortSlaveMP::sendRecv() protocol error %d",(int)ok);

+ 1 - 1
thorlcr/msort/tsorts.cpp

@@ -103,7 +103,7 @@ private:
                     StringBuffer err;
                     err.append("Cannot create ").append(outidxfile->queryFilename());
                     LOG(MCerror, thorJob, "%s", err.str());
-                    throw MakeStringException(-1,err.str());
+                    throw MakeStringException(-1, "%s", err.str());
                 }
                 offset_t s = 0;
                 while (s<=lastofs) {

+ 1 - 1
thorlcr/slave/backup.cpp

@@ -107,7 +107,7 @@ class CThorBackupHandler : public CSimpleInterface, implements IBackup, implemen
             {
                 StringBuffer errMsg;
                 if (!currentAbort)
-                    LOG(MCwarning, thorJob, errMsg.append("Backup inconsistency detected, backup aborted: ").append(item->dst).str());
+                    LOG(MCwarning, thorJob, "%s", errMsg.append("Backup inconsistency detected, backup aborted: ").append(item->dst).str());
                 backupIFile->remove();
             }
         }

+ 2 - 2
thorlcr/slave/slave.cpp

@@ -61,7 +61,7 @@ ProcessSlaveActivity::~ProcessSlaveActivity()
     // NB: The activity thread should have already stopped,
     //     if it is still alive at job shutdown and cannot be joined then the thread is in an unknown state.
     if (!threaded.join(FATAL_ACTJOIN_TIMEOUT))
-        throw MakeThorFatal(NULL, TE_FailedToAbortSlaves, "Activity %"ACTPF"%d failed to stop", container.queryId());
+        throw MakeThorFatal(NULL, TE_FailedToAbortSlaves, "Activity %"ACTPF"d failed to stop", container.queryId());
     ActPrintLog("AFTER ProcessSlaveActivity : joining process thread");
 }
 
@@ -113,7 +113,7 @@ void ProcessSlaveActivity::main()
             m.append("standard library exception (std::exception ").append(es.what()).append(")");
         m.appendf(" in %"ACTPF"d",container.queryId());
         ActPrintLogEx(&queryContainer(), thorlog_null, MCerror, "%s", m.str());
-        exception.setown(MakeThorFatal(NULL, TE_UnknownException, m.str()));
+        exception.setown(MakeThorFatal(NULL, TE_UnknownException, "%s", m.str()));
     }
     catch (CATCHALL)
     {

+ 2 - 2
thorlcr/slave/slwatchdog.cpp

@@ -116,7 +116,7 @@ public:
         CriticalBlock b(crit);
         activeGraphs.append(*LINK(&graph));
         StringBuffer str("Watchdog: Start Job ");
-        LOG(MCdebugProgress, thorJob, str.append(graph.queryGraphId()).str());
+        LOG(MCdebugProgress, thorJob, "%s", str.append(graph.queryGraphId()).str());
     }
     void stopGraph(CGraphBase &graph, HeartBeatPacket *hb)
     {
@@ -124,7 +124,7 @@ public:
         if (NotFound != activeGraphs.find(graph))
         {
             StringBuffer str("Watchdog: Stop Job ");
-            LOG(MCdebugProgress, thorJob, str.append(graph.queryGraphId()).str());
+            LOG(MCdebugProgress, thorJob, "%s", str.append(graph.queryGraphId()).str());
             if (hb)
                 gatherData(*hb);
             activeGraphs.zap(graph);

+ 1 - 1
thorlcr/slave/thslavemain.cpp

@@ -82,7 +82,7 @@ static void replyError(const char *errorMsg)
     StringBuffer str("Node '");
     myEp.getUrlStr(str);
     str.append("' exception: ").append(errorMsg);
-    Owned<IException> e = MakeStringException(0, str.str());
+    Owned<IException> e = MakeStringException(0, "%s", str.str());
     CMessageBuffer msg;
     serializeException(e, msg);
     queryClusterComm().send(msg, 0, MPTAG_THORREGISTRATION);

+ 25 - 17
thorlcr/thorutil/thormisc.hpp

@@ -211,11 +211,13 @@ interface IRemoteConnection;
 enum ActLogEnum { thorlog_null=0,thorlog_ecl=1,thorlog_all=2 };
 
 extern graph_decl StringBuffer &ActPrintLogArgsPrep(StringBuffer &res, const CGraphElementBase *container, const ActLogEnum flags, const char *format, va_list args);
-extern graph_decl void ActPrintLogEx(const CGraphElementBase *container, const ActLogEnum flags, const LogMsgCategory &logCat, const char *format, ...);
+extern graph_decl void ActPrintLogEx(const CGraphElementBase *container, const ActLogEnum flags, const LogMsgCategory &logCat, const char *format, ...) __attribute__((format(printf, 4, 5)));
 extern graph_decl void ActPrintLogArgs(const CGraphElementBase *container, const ActLogEnum flags, const LogMsgCategory &logCat, const char *format, va_list args);
 extern graph_decl void ActPrintLogArgs(const CGraphElementBase *container, IException *e, const ActLogEnum flags, const LogMsgCategory &logCat, const char *format, va_list args);
-extern graph_decl void ActPrintLog(const CActivityBase *activity, const char *format, ...);
-extern graph_decl void ActPrintLog(const CActivityBase *activity, IException *e, const char *format, ...);
+extern graph_decl void ActPrintLog(const CActivityBase *activity, const char *format, ...) __attribute__((format(printf, 2, 3)));
+extern graph_decl void ActPrintLog(const CActivityBase *activity, IException *e, const char *format, ...) __attribute__((format(printf, 3, 4)));
+
+inline void ActPrintLog(const CGraphElementBase *container, const char *format, ...) __attribute__((format(printf, 2, 3)));
 inline void ActPrintLog(const CGraphElementBase *container, const char *format, ...)
 {
     va_list args;
@@ -223,6 +225,7 @@ inline void ActPrintLog(const CGraphElementBase *container, const char *format,
     ActPrintLogArgs(container, thorlog_ecl, MCdebugProgress, format, args);
     va_end(args);
 }
+inline void ActPrintLogEx(const CGraphElementBase *container, IException *e, const ActLogEnum flags, const LogMsgCategory &logCat, const char *format, ...) __attribute__((format(printf, 5, 6)));
 inline void ActPrintLogEx(const CGraphElementBase *container, IException *e, const ActLogEnum flags, const LogMsgCategory &logCat, const char *format, ...)
 {
     va_list args;
@@ -230,6 +233,7 @@ inline void ActPrintLogEx(const CGraphElementBase *container, IException *e, con
     ActPrintLogArgs(container, e, flags, logCat, format, args);
     va_end(args);
 }
+inline void ActPrintLog(const CGraphElementBase *container, IException *e, const char *format, ...) __attribute__((format(printf, 3, 4)));
 inline void ActPrintLog(const CGraphElementBase *container, IException *e, const char *format, ...)
 {
     va_list args;
@@ -240,7 +244,9 @@ inline void ActPrintLog(const CGraphElementBase *container, IException *e, const
 extern graph_decl void GraphPrintLogArgsPrep(StringBuffer &res, CGraphBase *graph, const ActLogEnum flags, const LogMsgCategory &logCat, const char *format, va_list args);
 extern graph_decl void GraphPrintLogArgs(CGraphBase *graph, IException *e, const ActLogEnum flags, const LogMsgCategory &logCat, const char *format, va_list args);
 extern graph_decl void GraphPrintLogArgs(CGraphBase *graph, const ActLogEnum flags, const LogMsgCategory &logCat, const char *format, va_list args);
-extern graph_decl void GraphPrintLog(CGraphBase *graph, IException *e, const char *format, ...);
+extern graph_decl void GraphPrintLog(CGraphBase *graph, IException *e, const char *format, ...) __attribute__((format(printf, 3, 4)));
+
+inline void GraphPrintLogEx(CGraphBase *graph, ActLogEnum flags, const LogMsgCategory &logCat, const char *format, ...) __attribute__((format(printf, 4, 5)));
 inline void GraphPrintLogEx(CGraphBase *graph, ActLogEnum flags, const LogMsgCategory &logCat, const char *format, ...)
 {
     va_list args;
@@ -248,6 +254,7 @@ inline void GraphPrintLogEx(CGraphBase *graph, ActLogEnum flags, const LogMsgCat
     GraphPrintLogArgs(graph, flags, logCat, format, args);
     va_end(args);
 }
+inline void GraphPrintLogEx(CGraphBase *graph, IException *e, ActLogEnum flags, const LogMsgCategory &logCat, const char *format, ...) __attribute__((format(printf, 5, 6)));
 inline void GraphPrintLogEx(CGraphBase *graph, IException *e, ActLogEnum flags, const LogMsgCategory &logCat, const char *format, ...)
 {
     va_list args;
@@ -255,6 +262,7 @@ inline void GraphPrintLogEx(CGraphBase *graph, IException *e, ActLogEnum flags,
     GraphPrintLogArgs(graph, e, flags, logCat, format, args);
     va_end(args);
 }
+inline void GraphPrintLog(CGraphBase *graph, const char *format, ...) __attribute__((format(printf, 2, 3)));
 inline void GraphPrintLog(CGraphBase *graph, const char *format, ...)
 {
     va_list args;
@@ -262,20 +270,20 @@ inline void GraphPrintLog(CGraphBase *graph, const char *format, ...)
     GraphPrintLogArgs(graph, thorlog_null, MCdebugProgress, format, args);
     va_end(args);
 }
-extern graph_decl IThorException *MakeActivityException(CActivityBase *activity, int code, const char *_format, ...);
-extern graph_decl IThorException *MakeActivityException(CActivityBase *activity, IException *e, const char *xtra=NULL, ...);
-extern graph_decl IThorException *MakeActivityWarning(CActivityBase *activity, int code, const char *_format, ...);
-extern graph_decl IThorException *MakeActivityWarning(CActivityBase *activity, IException *e, const char *format, ...);
-extern graph_decl IThorException *MakeActivityException(CGraphElementBase *activity, int code, const char *_format, ...);
-extern graph_decl IThorException *MakeActivityException(CGraphElementBase *activity, IException *e, const char *xtra=NULL, ...);
-extern graph_decl IThorException *MakeActivityWarning(CGraphElementBase *activity, int code, const char *_format, ...);
-extern graph_decl IThorException *MakeActivityWarning(CGraphElementBase *activity, IException *e, const char *format, ...);
-extern graph_decl IThorException *MakeThorException(int code, const char *format, ...);
+extern graph_decl IThorException *MakeActivityException(CActivityBase *activity, int code, const char *_format, ...) __attribute__((format(printf, 3, 4)));
+extern graph_decl IThorException *MakeActivityException(CActivityBase *activity, IException *e, const char *xtra=NULL, ...) __attribute__((format(printf, 3, 4)));
+extern graph_decl IThorException *MakeActivityWarning(CActivityBase *activity, int code, const char *_format, ...) __attribute__((format(printf, 3, 4)));
+extern graph_decl IThorException *MakeActivityWarning(CActivityBase *activity, IException *e, const char *format, ...) __attribute__((format(printf, 3, 4)));
+extern graph_decl IThorException *MakeActivityException(CGraphElementBase *activity, int code, const char *_format, ...) __attribute__((format(printf, 3, 4)));
+extern graph_decl IThorException *MakeActivityException(CGraphElementBase *activity, IException *e, const char *xtra=NULL, ...) __attribute__((format(printf, 3, 4)));
+extern graph_decl IThorException *MakeActivityWarning(CGraphElementBase *activity, int code, const char *_format, ...) __attribute__((format(printf, 3, 4)));
+extern graph_decl IThorException *MakeActivityWarning(CGraphElementBase *activity, IException *e, const char *format, ...) __attribute__((format(printf, 3, 4)));
+extern graph_decl IThorException *MakeThorException(int code, const char *format, ...) __attribute__((format(printf, 2, 3)));
 extern graph_decl IThorException *MakeThorException(IException *e);
-extern graph_decl IThorException *MakeThorAudienceException(LogMsgAudience audience, int code, const char *format, ...);
-extern graph_decl IThorException *MakeThorOperatorException(int code, const char *format, ...);
-extern graph_decl IThorException *MakeThorFatal(IException *e, int code, const char *format, ...);
-extern graph_decl IThorException *ThorWrapException(IException *e, const char *msg, ...);
+extern graph_decl IThorException *MakeThorAudienceException(LogMsgAudience audience, int code, const char *format, ...) __attribute__((format(printf, 3, 4)));
+extern graph_decl IThorException *MakeThorOperatorException(int code, const char *format, ...) __attribute__((format(printf, 2, 3)));
+extern graph_decl IThorException *MakeThorFatal(IException *e, int code, const char *format, ...) __attribute__((format(printf, 3, 4)));
+extern graph_decl IThorException *ThorWrapException(IException *e, const char *msg, ...) __attribute__((format(printf, 2, 3)));
 extern graph_decl void setExceptionActivityInfo(CGraphElementBase &container, IThorException *e);
 //extern graph_decl void SetLogName(const char *prefix, const char *logdir, const char *thorname, bool master); 
 extern graph_decl StringBuffer &getLogDir(const char *prefix, const char *logdir, StringBuffer &ret); 

+ 1 - 1
tools/backupnode/backupnode.cpp

@@ -741,7 +741,7 @@ int main(int argc, const char *argv[])
                     println("Creating part lists, please wait...");
                 StringBuffer errstr;
                 if (!outputPartsFiles(args.item(0),args.item(1),args.item(2),errstr))
-                    throw MakeStringException(-1,errstr.str());
+                    throw MakeStringException(-1, "%s", errstr.str());
             }
         }
         else

+ 1 - 1
tools/hidl/hidlcomp.cpp

@@ -5592,7 +5592,7 @@ void EspServInfo::write_esp_binding()
     outs("\tresponse->set_status(SOAP_CLIENT_ERROR);\n");
     outs("\tStringBuffer msg, svcName;\n");
     outs("\tmsg.appendf(\"Method %s not available in service %s\",thecall->get_name(),getServiceName(svcName).str());\n");
-    outs("\tERRLOG(msg);\n");
+    outs("\tERRLOG(\"%s\", msg.str());\n");
     outs("\tresponse->set_err(msg);\n");
     outs("\treturn -1;\n");
     outs("}\n");

+ 2 - 2
tools/swapnode/swapnode.cpp

@@ -129,10 +129,10 @@ static IRemoteConnection* GetRemoteLock(const char* path, unsigned int mode, boo
                WARNLOG("%s",sMsg.str());
                return NULL;
            }
-           throw ::MakeStringException(-1, sMsg.str());
+           throw ::MakeStringException(-1, "%s", sMsg.str());
        }
        else
-           throw ::MakeStringException(-1, sErrMsg.str());
+           throw ::MakeStringException(-1, "%s", sErrMsg.str());
     }
 
     return pRemoteConnection;