Skip to content

Commit 3107b45

Browse files
authored
pythongh-108253: Fix reads of uninitialized memory in funcobject.c (python#108383)
1 parent 513c89d commit 3107b45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Objects/funcobject.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ _PyFunction_FromConstructor(PyFrameConstructor *constr)
131131
op->func_annotations = NULL;
132132
op->func_typeparams = NULL;
133133
op->vectorcall = _PyFunction_Vectorcall;
134-
_PyFunction_SetVersion(op, 0);
134+
op->func_version = 0;
135135
_PyObject_GC_TRACK(op);
136136
handle_func_event(PyFunction_EVENT_CREATE, op, NULL);
137137
return op;
@@ -207,7 +207,7 @@ PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname
207207
op->func_annotations = NULL;
208208
op->func_typeparams = NULL;
209209
op->vectorcall = _PyFunction_Vectorcall;
210-
_PyFunction_SetVersion(op, 0);
210+
op->func_version = 0;
211211
_PyObject_GC_TRACK(op);
212212
handle_func_event(PyFunction_EVENT_CREATE, op, NULL);
213213
return (PyObject *)op;

0 commit comments

Comments
 (0)