]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-128212: Fix race in `_PyUnicode_CheckConsistency` (GH-128367)
authorSam Gross <colesbury@gmail.com>
Thu, 2 Jan 2025 19:02:54 +0000 (14:02 -0500)
committerGitHub <noreply@github.com>
Thu, 2 Jan 2025 19:02:54 +0000 (14:02 -0500)
commit8eebe4e6d02bb4ad3f1ca6c52624186903dce893
tree1f490d057becb68f109b960e38afbed6ee58fa51
parentc9356feef28e6dfc4dc32830d3427a5ae0e426e2
gh-128212: Fix race in `_PyUnicode_CheckConsistency` (GH-128367)

There was a data race on the utf8 field between `PyUnicode_SET_UTF8` and
`_PyUnicode_CheckConsistency`. Use the `_PyUnicode_UTF8()` accessor,
which uses an atomic load internally, to avoid the data race.
Objects/unicodeobject.c