]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-142168: explicitly initialize `stack_array` in `_PyEval_Vector` and `_PyEvalFrameP...
authorKir Chou <148194051+gkirchou@users.noreply.github.com>
Sat, 6 Dec 2025 18:59:52 +0000 (03:59 +0900)
committerGitHub <noreply@github.com>
Sat, 6 Dec 2025 18:59:52 +0000 (19:59 +0100)
Co-authored-by: Kir Chou <note351@hotmail.com>
Python/ceval.c

index 46bf644106ac39601384d1c0e64f5dd9f18ea770..aadc6369cbe5200bab5e341d803810bd608e084a 100644 (file)
@@ -2344,7 +2344,7 @@ _PyEvalFramePushAndInit_Ex(PyThreadState *tstate, _PyStackRef func,
     PyObject *kwnames = NULL;
     _PyStackRef *newargs;
     PyObject *const *object_array = NULL;
-    _PyStackRef stack_array[8];
+    _PyStackRef stack_array[8] = {0};
     if (has_dict) {
         object_array = _PyStack_UnpackDict(tstate, _PyTuple_ITEMS(callargs), nargs, kwargs, &kwnames);
         if (object_array == NULL) {
@@ -2407,7 +2407,7 @@ _PyEval_Vector(PyThreadState *tstate, PyFunctionObject *func,
     if (kwnames) {
         total_args += PyTuple_GET_SIZE(kwnames);
     }
-    _PyStackRef stack_array[8];
+    _PyStackRef stack_array[8] = {0};
     _PyStackRef *arguments;
     if (total_args <= 8) {
         arguments = stack_array;