Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Avoid possible crash in ``typeobject.c`` where a device has no memory left.
Now it properly raises a :exc:`MemoryError`. Patch by Ivy Xu.
1 change: 1 addition & 0 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -5492,6 +5492,7 @@ type_from_slots_or_spec(
Py_ssize_t name_buf_len = strlen(it.name) + 1;
_ht_tpname = PyMem_Malloc(name_buf_len);
if (_ht_tpname == NULL) {
PyErr_NoMemory();
goto finally;
}
memcpy(_ht_tpname, it.name, name_buf_len);
Expand Down
Loading