https://github.com/python/cpython/commit/80e6d3ec4972220587c8b883161311a49ea8d0ff
commit: 80e6d3ec4972220587c8b883161311a49ea8d0ff
branch: main
author: Donghee Na <donghee...@python.org>
committer: corona10 <donghee.n...@gmail.com>
date: 2025-03-04T22:50:33+09:00
summary:

gh-130547: Fix race between dict_dealloc and split_keys_entry_added (gh-130778)

files:
M Objects/dictobject.c

diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index e30d626439e7f8..8a30c4082e9236 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -3254,7 +3254,7 @@ dict_dealloc(PyObject *self)
     Py_TRASHCAN_BEGIN(mp, dict_dealloc)
     if (values != NULL) {
         if (values->embedded == 0) {
-            for (i = 0, n = mp->ma_keys->dk_nentries; i < n; i++) {
+            for (i = 0, n = values->capacity; i < n; i++) {
                 Py_XDECREF(values->values[i]);
             }
             free_values(values, false);

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to