gh-108253: Fix reads of uninitialized memory in funcobject.c (#108383)

This commit is contained in:
Guido van Rossum 2023-08-23 15:36:19 -07:00 committed by GitHub
parent 513c89d012
commit 3107b453bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -131,7 +131,7 @@ _PyFunction_FromConstructor(PyFrameConstructor *constr)
op->func_annotations = NULL;
op->func_typeparams = NULL;
op->vectorcall = _PyFunction_Vectorcall;
_PyFunction_SetVersion(op, 0);
op->func_version = 0;
_PyObject_GC_TRACK(op);
handle_func_event(PyFunction_EVENT_CREATE, op, NULL);
return op;
@ -207,7 +207,7 @@ PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname
op->func_annotations = NULL;
op->func_typeparams = NULL;
op->vectorcall = _PyFunction_Vectorcall;
_PyFunction_SetVersion(op, 0);
op->func_version = 0;
_PyObject_GC_TRACK(op);
handle_func_event(PyFunction_EVENT_CREATE, op, NULL);
return (PyObject *)op;