summaryrefslogtreecommitdiffstats
path: root/Modules/_struct.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-02-13 11:01:07 (GMT)
committerGeorg Brandl <georg@python.org>2009-02-13 11:01:07 (GMT)
commit75c3d6ff092f67d1c5aff1d05fcdef1ef1a5bae3 (patch)
tree6b94d7ef6c2383c31d936c10e31c457656ee6088 /Modules/_struct.c
parentc8dcfb6cece2da41d7b86879af1f4b81f98d70df (diff)
downloadcpython-75c3d6ff092f67d1c5aff1d05fcdef1ef1a5bae3.zip
cpython-75c3d6ff092f67d1c5aff1d05fcdef1ef1a5bae3.tar.gz
cpython-75c3d6ff092f67d1c5aff1d05fcdef1ef1a5bae3.tar.bz2
#3694: fix an "XXX undetected error" leak in struct.
Diffstat (limited to 'Modules/_struct.c')
-rw-r--r--Modules/_struct.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 94cb303..57441c4 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -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;