Skip to content

Commit fdf2efc

Browse files
committed
gh-142399: Lock both so and otherset when setting a symmetric difference
Only so is locked, which leaves otherset vulnerable.
1 parent 7099af8 commit fdf2efc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Objects/setobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,9 +2005,9 @@ set_symmetric_difference_update_impl(PySetObject *so, PyObject *other)
20052005
return NULL;
20062006
}
20072007

2008-
Py_BEGIN_CRITICAL_SECTION(so);
2008+
Py_BEGIN_CRITICAL_SECTION2(so, otherset);
20092009
rv = set_symmetric_difference_update_set(so, otherset);
2010-
Py_END_CRITICAL_SECTION();
2010+
Py_END_CRITICAL_SECTION2();
20112011

20122012
Py_DECREF(otherset);
20132013
}

0 commit comments

Comments
 (0)