]> granicus.if.org Git - python/commitdiff
list2set(): PyList_GetItem could fail.
authorBarry Warsaw <barry@python.org>
Fri, 13 Dec 1996 23:22:42 +0000 (23:22 +0000)
committerBarry Warsaw <barry@python.org>
Fri, 13 Dec 1996 23:22:42 +0000 (23:22 +0000)
Modules/selectmodule.c

index a1e3cf0deacb79c7604d5c54476060e95d76bcad..dfe95484cfd862076a011e40d3195217cc0bc6a1 100644 (file)
@@ -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)) {