diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-12-17 13:11:24 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-12-17 13:11:24 (GMT) |
commit | 48d761e2b4b8cef40349aa286f6f46fc6c6d0fa7 (patch) | |
tree | c009c8128146dc5919a04caf26e9e97414fcd706 /Python | |
parent | 87a854dc732ac3d2e64d8c2935bf1d77c8de5032 (diff) | |
download | cpython-48d761e2b4b8cef40349aa286f6f46fc6c6d0fa7.zip cpython-48d761e2b4b8cef40349aa286f6f46fc6c6d0fa7.tar.gz cpython-48d761e2b4b8cef40349aa286f6f46fc6c6d0fa7.tar.bz2 |
Issue #16404: Add checks for return value of PyLong_FromLong() in
sys.getwindowsversion() and ossaudiodev.setparameters().
Reported by Ned Batchelder.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/sysmodule.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 880385c..222630c 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -747,6 +747,10 @@ sys_getwindowsversion(PyObject *self) PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.wSuiteMask)); PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.wProductType)); + if (PyErr_Occurred()) { + Py_DECREF(version); + return NULL; + } return version; } |