Преглед изворни кода

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 пре 4 година
родитељ
комит
73c729ef52
1 измењених фајлова са 2 додато и 1 уклоњено
  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);