Skip to content

Commit 8c92ca6

Browse files
committed
Fix use after free
1 parent 4cfbc4f commit 8c92ca6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Objects/dictobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7173,6 +7173,7 @@ _PyDict_DetachFromObject(PyDictObject *mp, PyObject *obj)
71737173

71747174
PyDictValues *values = copy_values(mp->ma_values);
71757175

7176+
mp->ma_values = values;
71767177
if (values == NULL) {
71777178
/* Out of memory. Clear the dict */
71787179
PyInterpreterState *interp = _PyInterpreterState_GET();
@@ -7183,7 +7184,6 @@ _PyDict_DetachFromObject(PyDictObject *mp, PyObject *obj)
71837184
PyErr_NoMemory();
71847185
return -1;
71857186
}
7186-
mp->ma_values = values;
71877187

71887188
FT_ATOMIC_STORE_UINT8(_PyObject_InlineValues(obj)->valid, 0);
71897189

0 commit comments

Comments
 (0)