C++/Qt/PythonQt schwere Qualitätsfehler in PythonQt - Rückgabe von einen umbestimmten Wert

in #proofofbrain3 years ago (edited)

Ich habe ein Haufen Qualitäts/Sicherheitsprobleme gefunden; es wird ein uninitialisierter Wert zurückgegeben, das führt zu Folgeproblemen, die man nur schwer findet und Qualitätsproblemen, sowie Sicherheitslücken:

pythonqt/generated_cpp_56/com_trolltech_qt_gui/com_trolltech_qt_gui0.cpp:6667

//PythonQt 3.2.0

QPainter*  PythonQtShell_QAbstractPrintDialog::sharedPainter() const
{
if (_wrapper) {
  PYTHONQT_GIL_SCOPE
  if (((PyObject*)_wrapper)->ob_refcnt > 0) {
    static PyObject* name = PyString_FromString("sharedPainter");
    PyObject* obj = PyBaseObject_Type.tp_getattro((PyObject*)_wrapper, name);
    if (obj) {
      static const char* argumentList[] ={"QPainter*"};
      static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList);
      QPainter* returnValue;      #<----------- HIER FEHLER
      void* args[1] = {NULL};
      PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true);
      if (result) {
        args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue);
        if (args[0]!=&returnValue) {
          if (args[0]==NULL) {
            PythonQt::priv()->handleVirtualOverloadReturnError("sharedPainter", methodInfo, result);
          } else {
            returnValue = *((QPainter**)args[0]);
          }
        }
      }
      if (result) { Py_DECREF(result); } 
      Py_DECREF(obj);
     return returnValue;          #<----------- HIER
    } else {
      PyErr_Clear();
    }
  }
}
  return QAbstractPrintDialog::sharedPainter();
}