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
Attachments
For Gerrit Dashboard: PYSIDE-2796 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
570798,2 | Potential fix for crash currentOpcode_Is_CallMethNoArgs() | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
571546,2 | Potential fix for crash currentOpcode_Is_CallMethNoArgs() | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
571626,3 | Potential fix for crash currentOpcode_Is_CallMethNoArgs() | tqtc/lts-6.5 | pyside/tqtc-pyside-setup | Status: MERGED | +2 | 0 |