Merged revisions 66693 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r66693 | benjamin.peterson | 2008-09-29 21:11:07 -0500 (Mon, 29 Sep 2008) | 4 lines
Victor Stinner's patches to check the return result of PyLong_Ssize_t
reviewed by Amaury
........
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 4a257c0..ac70f43 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1786,6 +1786,8 @@
/* Extract the offset from the first argument */
offset = PyLong_AsSsize_t(PyTuple_GET_ITEM(args, 1));
+ if (offset == -1 && PyErr_Occurred())
+ return NULL;
/* Support negative offsets. */
if (offset < 0)