summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-12-17 13:09:45 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-12-17 13:09:45 (GMT)
commit15df36bb14e35489d841898069e3878f2144e48e (patch)
treed1b4122407f46de7b1a8263a8f20fbedbff7b3d8 /Python/sysmodule.c
parent0585418b0d50755500587a887f3a901f8149cd00 (diff)
downloadcpython-15df36bb14e35489d841898069e3878f2144e48e.zip
cpython-15df36bb14e35489d841898069e3878f2144e48e.tar.gz
cpython-15df36bb14e35489d841898069e3878f2144e48e.tar.bz2
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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index fa66eb4..2c364af 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;
}