diff options
author | Barry Warsaw <barry@python.org> | 1996-12-13 23:22:42 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1996-12-13 23:22:42 (GMT) |
commit | 24c4b3d4e8ca9f8bdc344952aa08fa7288c0b5e8 (patch) | |
tree | 65c3eea4206bb9564a382b3eb658b4d22c00f086 /Modules/selectmodule.c | |
parent | 094579e6775891ca0374af5a8ec1f8b8e93157c6 (diff) | |
download | cpython-24c4b3d4e8ca9f8bdc344952aa08fa7288c0b5e8.zip cpython-24c4b3d4e8ca9f8bdc344952aa08fa7288c0b5e8.tar.gz cpython-24c4b3d4e8ca9f8bdc344952aa08fa7288c0b5e8.tar.bz2 |
list2set(): PyList_GetItem could fail.
Diffstat (limited to 'Modules/selectmodule.c')
-rw-r--r-- | Modules/selectmodule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index a1e3cf0..dfe95484 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -100,7 +100,9 @@ list2set(list, set, fd2obj) SOCKET v; /* any intervening fileno() calls could decr this refcnt */ - o = PyList_GetItem(list, i); + if (!(o = PyList_GetItem(list, i))) + return NULL; + Py_INCREF(o); if (PyInt_Check(o)) { |