Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2796

currentOpcode_Is_CallMethNoArgs dereferences a NULL pointer

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.8.0, 6.7.3
    • 6.4.0, 6.5.0, 6.6.0, 6.7, 6.7.0
    • PySide
    • None
    • FreeCAD, Arch Linux
    • All
    • 72f4c6a3c (dev), 1faf07c72 (6.7), c2ed98976 (tqtc/lts-6.5)

    Description

      The following code has been around since 6.4.0 sources/shiboken6/libshiboken/sbkfeature_base.cpp:129
       

      static bool currentOpcode_Is_CallMethNoArgs()
          // PYSIDE-2221: Special case for the NoGil version:
          //              Find out if we have such a version.
          //              We could also ask the variable `Py_NOGIL`.
          static PyObject *flags = PySys_GetObject("flags");
          static bool isNoGil = PyObject_HasAttrString(flags, "nogil");
          // We look into the currently active operation if we are going to call
          // a method with zero arguments.
          auto *frame = PyEval_GetFrame();
      #if !Py_LIMITED_API && !defined(PYPY_VERSION)
          auto *f_code = PyFrame_GetCode(frame);
      #else
       

      PyEval_GetFrame can return NULL, and passing this to PyFrame_GetCode can crash.

      This issue affects FreeCAD and causes crashing during tab complete: https://github.com/FreeCAD/FreeCAD/issues/14101

      Attachments

        For Gerrit Dashboard: PYSIDE-2796
        # Subject Branch Project Status CR V

        Activity

          People

            kleint Friedemann Kleint
            jookia John Watts
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes