diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-08-20 19:30:46 +0200 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-08-20 19:30:46 +0200 |
commit | 10f40cd64c5c853c6da463f7dd1df6427f5d8535 (patch) | |
tree | e1a7afd9199a5349485842e6cf57998cb50cc720 /Python/pystate.c | |
parent | 40c8f92f7f7cf1131813bd80c4fd4bcbf7108d6a (diff) | |
download | cpython-10f40cd64c5c853c6da463f7dd1df6427f5d8535.tar.gz |
Issue #15726: Fix incorrect bounds checking in PyState_FindModule.
Patch by Robin Schreiber.
Diffstat (limited to 'Python/pystate.c')
-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 31b5423d38..13923313c0 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -248,7 +248,7 @@ PyState_FindModule(struct PyModuleDef* m) 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; |