diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2020-10-25 06:08:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-25 06:08:17 (GMT) |
commit | 492d513ccbebeec40a8ba85cbd894a027ca5b2b3 (patch) | |
tree | c701fc6d9d0419feecf4b9d48b238dbf50f60d23 /Objects | |
parent | 4a9c6379380defd37b5483607d0d804db18f7812 (diff) | |
download | cpython-492d513ccbebeec40a8ba85cbd894a027ca5b2b3.zip cpython-492d513ccbebeec40a8ba85cbd894a027ca5b2b3.tar.gz cpython-492d513ccbebeec40a8ba85cbd894a027ca5b2b3.tar.bz2 |
Correctly compare the hint against the keys in _PyDict_GetItemHint (GH-22960)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/dictobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 8e74962..42d71e5 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -1448,7 +1448,7 @@ _PyDict_GetItemHint(PyDictObject *mp, PyObject *key, assert(PyDict_CheckExact((PyObject*)mp)); assert(PyUnicode_CheckExact(key)); - if (hint >= 0 && hint < _PyDict_KeysSize(mp->ma_keys)) { + if (hint >= 0 && hint < mp->ma_keys->dk_nentries) { PyObject *res = NULL; PyDictKeyEntry *ep = DK_ENTRIES(mp->ma_keys) + (size_t)hint; |