]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-105673: Fix uninitialized warning in sysmodule.c (GH-105674) (#105676)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 12 Jun 2023 09:13:03 +0000 (02:13 -0700)
committerGitHub <noreply@github.com>
Mon, 12 Jun 2023 09:13:03 +0000 (09:13 +0000)
In sys_add_xoption(), 'value' may be uninitialized for some error paths.
(cherry picked from commit a8d69fe92c65d636fc454cfb1825c357eb2e6325)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Python/sysmodule.c

index 84f17389559cf6e4068bf3dfa8d0e262d9b1d534..6e9ec90c9d1c3e47de0a2f10bc66574c88f19df9 100644 (file)
@@ -3020,7 +3020,7 @@ err_occurred:
 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) {