]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Check return value of PyList_Append() in Py_Main(). CID 1353200
authorChristian Heimes <christian@python.org>
Thu, 8 Sep 2016 22:08:35 +0000 (00:08 +0200)
committerChristian Heimes <christian@python.org>
Thu, 8 Sep 2016 22:08:35 +0000 (00:08 +0200)
Modules/main.c

index b6dcdd0a30a8bb57dc109fdb43f030f9bf770032..0b82f480a6a90a397ac53cda7d9bbd1a69a3e751 100644 (file)
@@ -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;