diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-08-20 17:31:52 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-08-20 17:31:52 (GMT) |
commit | 35503c9c1444ef4ee11ec403d7848f0240cacc9e (patch) | |
tree | e8c4473faf2b738c3e7c3d4ed7547915b3540cf1 /Python | |
parent | 66d1eb23d42551f510f27f4610d74442579e98d8 (diff) | |
parent | 75506e8b7cc1b21fd10997e4e5d382c515558fa8 (diff) | |
download | cpython-35503c9c1444ef4ee11ec403d7848f0240cacc9e.zip cpython-35503c9c1444ef4ee11ec403d7848f0240cacc9e.tar.gz cpython-35503c9c1444ef4ee11ec403d7848f0240cacc9e.tar.bz2 |
Issue #15726: Fix incorrect bounds checking in PyState_FindModule.
Patch by Robin Schreiber.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/pystate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index cf08a2b..8dc570a 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -248,7 +248,7 @@ PyState_FindModule(struct PyModuleDef* module) return NULL; if (state->modules_by_index == NULL) return NULL; - if (index > PyList_GET_SIZE(state->modules_by_index)) + if (index >= PyList_GET_SIZE(state->modules_by_index)) return NULL; res = PyList_GET_ITEM(state->modules_by_index, index); return res==Py_None ? NULL : res; |