mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
#3694: fix an "XXX undetected error" leak in struct.
This commit is contained in:
parent
c8dcfb6cec
commit
75c3d6ff09
2 changed files with 5 additions and 1 deletions
|
@ -1785,7 +1785,7 @@ s_pack_into(PyObject *self, PyObject *args)
|
|||
assert( buffer_len >= 0 );
|
||||
|
||||
/* Extract the offset from the first argument */
|
||||
offset = PyLong_AsSsize_t(PyTuple_GET_ITEM(args, 1));
|
||||
offset = PyNumber_AsSsize_t(PyTuple_GET_ITEM(args, 1), PyExc_IndexError);
|
||||
if (offset == -1 && PyErr_Occurred())
|
||||
return NULL;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue