# Bug report ### Bug description: Original gist: https://gist.githubusercontent.com/devdanzin/55ed5cf0d452eb6ce881e7a8fad30ddb/raw/aec57efe5d45a6995757b60970173d5dca92f188/ceval_stackref_oom.md > > # ceval.c: Missing PyErr_NoMemory in _PyObjectArray_FromStackRefArray + PyEval_GetLocals NULL deref > > ## Summary > > 1. `_PyObjectArray_FromStackRefArray` (line 1112): `PyMem_Malloc` returns NULL without exception. Affects ~10 vectorcall functions → SystemError. > 2. `PyEval_GetLocals` (line 2622): `_PyFrame_GetFrameObject` can return NULL, immediately dereferenced → segfault. > > ## Fix > > 1. Add `PyErr_NoMemory()` after `PyMem_Malloc` failure. > 2. Add NULL check after `_PyFrame_GetFrameObject`. But the second `_PyFrame_GetFrameObject` issue is already resolved by https://github.com/python/cpython/pull/146124 ### CPython versions tested on: CPython main branch ### Operating systems tested on: _No response_ <!-- gh-linked-prs --> ### Linked PRs * gh-153206 * gh-153272 * gh-153273 <!-- /gh-linked-prs -->
Activity
gh-153205: Set `MemoryError` in stackref array conversion (#153206)
[3.14] gh-153205: Set `MemoryError` in stackref array conversion (GH-…
[3.15] gh-153205: Set `MemoryError` in stackref array conversion (GH-…