Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 4 additions & 2 deletions Objects/genobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,8 @@ gen_set_name(PyObject *self, PyObject *value, void *Py_UNUSED(ignored))
return -1;
}
Py_BEGIN_CRITICAL_SECTION(self);
// To prevent use-after-free from other threads that reference the gi_name.
// gh-133931: To prevent use-after-free from other threads that reference
// the gi_name.
_PyObject_XSetRefDelayed(&op->gi_name, Py_NewRef(value));
Py_END_CRITICAL_SECTION();
return 0;
Expand All @@ -747,7 +748,8 @@ gen_set_qualname(PyObject *self, PyObject *value, void *Py_UNUSED(ignored))
return -1;
}
Py_BEGIN_CRITICAL_SECTION(self);
// To prevent use-after-free from other threads that reference the gi_qualname.
// gh-133931: To prevent use-after-free from other threads that reference
// the gi_qualname.
_PyObject_XSetRefDelayed(&op->gi_qualname, Py_NewRef(value));
Py_END_CRITICAL_SECTION();
return 0;
Expand Down
3 changes: 2 additions & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -3967,7 +3967,8 @@ _PyObject_SetDict(PyObject *obj, PyObject *value)
return -1;
}
Py_BEGIN_CRITICAL_SECTION(obj);
// To prevent use-after-free from other threads that reference the __dict__
// gh-133931: To prevent use-after-free from other threads that reference
Copy link
Member

@efimov-mikhail efimov-mikhail Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct issue reference for __dict__ too?

// the __dict__
_PyObject_XSetRefDelayed(dictptr, Py_NewRef(value));
Py_END_CRITICAL_SECTION();
return 0;
Expand Down
Loading