[Python-checkins] gh-105673: Fix uninitialized warning in sysmodule.c (#105674)

erlend-aasland webhook-mailer at python.org
Mon Jun 12 04:48:03 EDT 2023


https://github.com/python/cpython/commit/a8d69fe92c65d636fc454cfb1825c357eb2e6325
commit: a8d69fe92c65d636fc454cfb1825c357eb2e6325
branch: main
author: Nikita Sobolev <mail at sobolevn.me>
committer: erlend-aasland <erlend.aasland at protonmail.com>
date: 2023-06-12T08:47:56Z
summary:

gh-105673: Fix uninitialized warning in sysmodule.c (#105674)

In sys_add_xoption(), 'value' may be uninitialized for some error paths.

files:
M Python/sysmodule.c

diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 90e5e65dcf9f..f5d4711b0c2c 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -3375,7 +3375,7 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict)
 static int
 sys_add_xoption(PyObject *opts, const wchar_t *s)
 {
-    PyObject *name, *value;
+    PyObject *name, *value = NULL;
 
     const wchar_t *name_end = wcschr(s, L'=');
     if (!name_end) {



More information about the Python-checkins mailing list