mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Issue #15726: Fix incorrect bounds checking in PyState_FindModule.
Patch by Robin Schreiber.
This commit is contained in:
parent
07795df683
commit
75506e8b7c
3 changed files with 5 additions and 1 deletions
|
@ -848,6 +848,7 @@ Ralf Schmitt
|
||||||
Michael Schneider
|
Michael Schneider
|
||||||
Peter Schneider-Kamp
|
Peter Schneider-Kamp
|
||||||
Arvin Schnell
|
Arvin Schnell
|
||||||
|
Robin Schreiber
|
||||||
Chad J. Schroeder
|
Chad J. Schroeder
|
||||||
Sam Schulenburg
|
Sam Schulenburg
|
||||||
Stefan Schwarzer
|
Stefan Schwarzer
|
||||||
|
|
|
@ -10,6 +10,9 @@ What's New in Python 3.2.4
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #15726: Fix incorrect bounds checking in PyState_FindModule.
|
||||||
|
Patch by Robin Schreiber.
|
||||||
|
|
||||||
- Issue #15604: Update uses of PyObject_IsTrue() to check for and handle
|
- Issue #15604: Update uses of PyObject_IsTrue() to check for and handle
|
||||||
errors correctly. Patch by Serhiy Storchaka.
|
errors correctly. Patch by Serhiy Storchaka.
|
||||||
|
|
||||||
|
|
|
@ -248,7 +248,7 @@ PyState_FindModule(struct PyModuleDef* m)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (state->modules_by_index == NULL)
|
if (state->modules_by_index == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (index > PyList_GET_SIZE(state->modules_by_index))
|
if (index >= PyList_GET_SIZE(state->modules_by_index))
|
||||||
return NULL;
|
return NULL;
|
||||||
res = PyList_GET_ITEM(state->modules_by_index, index);
|
res = PyList_GET_ITEM(state->modules_by_index, index);
|
||||||
return res==Py_None ? NULL : res;
|
return res==Py_None ? NULL : res;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue