From 48d761e2b4b8cef40349aa286f6f46fc6c6d0fa7 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 17 Dec 2013 15:11:24 +0200 Subject: Issue #16404: Add checks for return value of PyLong_FromLong() in sys.getwindowsversion() and ossaudiodev.setparameters(). Reported by Ned Batchelder. --- Python/sysmodule.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Python/sysmodule.c') diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 880385c9cbf..222630c1693 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -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; } -- cgit v1.2.3