summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2023-08-23 22:36:19 (GMT)
committerGitHub <noreply@github.com>2023-08-23 22:36:19 (GMT)
commit3107b453bcceb0e2d2590fef3612859f2f802d72 (patch)
tree3c7f2f8c56850f8d847c596a766ef41f6ff8bd9c /Objects
parent513c89d0122ff6245cfefbb49ef32bde8a2336f5 (diff)
downloadcpython-3107b453bcceb0e2d2590fef3612859f2f802d72.zip
cpython-3107b453bcceb0e2d2590fef3612859f2f802d72.tar.gz
cpython-3107b453bcceb0e2d2590fef3612859f2f802d72.tar.bz2
gh-108253: Fix reads of uninitialized memory in funcobject.c (#108383)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/funcobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index 2820e47..648b660 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -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;