Fehler Beheber avatar

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

fehlerbeheber

Published: 27 Jun 2021 › Updated: 27 Jun 2021C++/Qt/PythonQt schwere Qualitätsfehler in PythonQt - Rückgabe von einen umbestimmten Wert

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

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();
}

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

Written by

Ich behebe Fehler in Software.

Read more #proofofbrain posts


Best Posts From Fehler Beheber

We have not curated any of fehlerbeheber's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Fehler Beheber