Explorar o código

HPCC-17298 Uninitialized member variable in Python plugin

Reported by Coverity

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman %!s(int64=8) %!d(string=hai) anos
pai
achega
2f88fcd7b5
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      plugins/pyembed/pyembed.cpp

+ 3 - 3
plugins/pyembed/pyembed.cpp

@@ -438,9 +438,9 @@ protected:
         out.appendf("\n__result__ = __user__(%s)\n", params);
         out.appendf("\n__result__ = __user__(%s)\n", params);
         return out;
         return out;
     }
     }
-    PyThreadState *tstate;
-    bool initialized;
-    HINSTANCE pythonLibrary;
+    PyThreadState *tstate = nullptr;
+    bool initialized = false;
+    HINSTANCE pythonLibrary = 0;
     OwnedPyObject namedtuple;      // collections.namedtuple
     OwnedPyObject namedtuple;      // collections.namedtuple
     OwnedPyObject namedtupleTypes; // dictionary of return values from namedtuple()
     OwnedPyObject namedtupleTypes; // dictionary of return values from namedtuple()
     OwnedPyObject compiledScripts; // dictionary of previously compiled scripts
     OwnedPyObject compiledScripts; // dictionary of previously compiled scripts