diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-12-17 13:12:46 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-12-17 13:12:46 (GMT) |
commit | 85c24979507c4986573cf3537d048324f71d7854 (patch) | |
tree | 2e463906b4b4f1c92b52ab91e0ba4d29cc851bcb /Python/sysmodule.c | |
parent | 11ee080ea77c037c5a0bd8de972b040930a9b7e6 (diff) | |
parent | 48d761e2b4b8cef40349aa286f6f46fc6c6d0fa7 (diff) | |
download | cpython-85c24979507c4986573cf3537d048324f71d7854.zip cpython-85c24979507c4986573cf3537d048324f71d7854.tar.gz cpython-85c24979507c4986573cf3537d048324f71d7854.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/sysmodule.c')
-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 46a6aa9..d238561 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -801,6 +801,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; } |