From: Christian Heimes Date: Thu, 8 Sep 2016 22:08:35 +0000 (+0200) Subject: Check return value of PyList_Append() in Py_Main(). CID 1353200 X-Git-Tag: v3.6.0b1~242 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=275270772e6b733beb5bf0e24f6d33663975cc63;p=thirdparty%2FPython%2Fcpython.git Check return value of PyList_Append() in Py_Main(). CID 1353200 --- diff --git a/Modules/main.c b/Modules/main.c index b6dcdd0a30a8..0b82f480a6a9 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -482,7 +482,8 @@ Py_Main(int argc, wchar_t **argv) warning_option = PyUnicode_FromWideChar(_PyOS_optarg, -1); if (warning_option == NULL) Py_FatalError("failure in handling of -W argument"); - PyList_Append(warning_options, warning_option); + if (PyList_Append(warning_options, warning_option) == -1) + Py_FatalError("failure in handling of -W argument"); Py_DECREF(warning_option); break;