Issue #16404: Add checks for return value of PyLong_FromLong() in

sys.getwindowsversion() and ossaudiodev.setparameters().
Reported by Ned Batchelder.
This commit is contained in:
Serhiy Storchaka 2013-12-17 15:11:24 +02:00
parent 87a854dc73
commit 48d761e2b4
2 changed files with 5 additions and 8 deletions

View file

@ -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;
}