From 275270772e6b733beb5bf0e24f6d33663975cc63 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 9 Sep 2016 00:08:35 +0200 Subject: Check return value of PyList_Append() in Py_Main(). CID 1353200 --- Modules/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/main.c b/Modules/main.c index b6dcdd0..0b82f48 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; -- cgit v0.12