diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-09-30 02:11:07 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-09-30 02:11:07 +0000 |
commit | 02252480336fbbf8507d51ccc88431fa59ecd07f (patch) | |
tree | c52148d32f770799251c8fdffdf534f8cacaef3b /Modules/_struct.c | |
parent | 8d77d448a53ed9d0607f1ad226056eb8ee8a48f8 (diff) | |
download | cpython-git-02252480336fbbf8507d51ccc88431fa59ecd07f.tar.gz |
Victor Stinner's patches to check the return result of PyLong_Ssize_t
reviewed by Amaury
Diffstat (limited to 'Modules/_struct.c')
-rw-r--r-- | Modules/_struct.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c index 078c3a53a8..30feaa6fb1 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -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) |