Procházet zdrojové kódy

Merge pull request #15084 from richardkchapman/instancestr

HPCC-26085 Potential illegal c++ code from coverity

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Merged-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday před 4 roky
rodič
revize
73c729ef52
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      roxie/topo/toposerver.cpp

+ 2 - 1
roxie/topo/toposerver.cpp

@@ -253,7 +253,8 @@ void doServer(ISocket *socket)
                         if (end != line.npos)
                         {
                             char *tail = nullptr;
-                            instance = strtoul(line.substr(end+1).c_str(), &tail, 10);
+                            std::string instanceStr = line.substr(end+1);
+                            instance = strtoul(instanceStr.c_str(), &tail, 10);
                             if (*tail)
                                 DBGLOG("Unexpected characters parsing instance value in topology entry %s", line.c_str());
                             line = line.substr(0, end);