commit | 4e6bf4b3da03b132b0698f30ee931a350585b117 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Mon May 11 19:59:21 2015 -0700 |
committer | Raymond Hettinger <python@rcn.com> | Mon May 11 19:59:21 2015 -0700 |
tree | e10485ec3c7bd9b2384eccfcf3856e879641a061 | |
parent | dc6a9c04234ffc95b4a6a74c19c234cd9aa6e8c2 [diff] | |
parent | b9db9e152f3325b075e59ef4fdecfd0b9ec4746c [diff] |
merge
diff --git a/Modules/_heapqmodule.c b/Modules/_heapqmodule.c index 5e724a1..01b35be 100644 --- a/Modules/_heapqmodule.c +++ b/Modules/_heapqmodule.c
@@ -235,6 +235,11 @@ return item; } + if (PyList_GET_SIZE(heap) == 0) { + PyErr_SetString(PyExc_IndexError, "index out of range"); + return NULL; + } + returnitem = PyList_GET_ITEM(heap, 0); Py_INCREF(item); PyList_SET_ITEM(heap, 0, item);