Victor Stinner's patches to check the return result of PyLong_Ssize_t

reviewed by Amaury
This commit is contained in:
Benjamin Peterson 2008-09-30 02:11:07 +00:00
parent 8d77d448a5
commit 0225248033
2 changed files with 10 additions and 0 deletions

View file

@ -1755,6 +1755,8 @@ s_pack_into(PyObject *self, PyObject *args)
/* Extract the offset from the first argument */
offset = PyInt_AsSsize_t(PyTuple_GET_ITEM(args, 1));
if (offset == -1 && PyErr_Occurred())
return NULL;
/* Support negative offsets. */
if (offset < 0)