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:12:46 +02:00
commit 85c2497950
2 changed files with 5 additions and 8 deletions

View file

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