diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-12-17 15:09:45 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-12-17 15:09:45 +0200 |
commit | 15df36bb14e35489d841898069e3878f2144e48e (patch) | |
tree | d1b4122407f46de7b1a8263a8f20fbedbff7b3d8 /Python/sysmodule.c | |
parent | 0585418b0d50755500587a887f3a901f8149cd00 (diff) | |
download | cpython-git-15df36bb14e35489d841898069e3878f2144e48e.tar.gz |
Issue #16404: Add checks for return value of PyInt_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 fa66eb4c41..2c364af0b7 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -616,6 +616,10 @@ sys_getwindowsversion(PyObject *self) PyStructSequence_SET_ITEM(version, pos++, PyInt_FromLong(ver.wSuiteMask)); PyStructSequence_SET_ITEM(version, pos++, PyInt_FromLong(ver.wProductType)); + if (PyErr_Occurred()) { + Py_DECREF(version); + return NULL; + } return version; } |