Details
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