summaryrefslogtreecommitdiffstats
path: root/Objects/call.c
diff options
context:
space:
mode:
authorZackery Spytz <Osmunda46@gmail.com>2017-07-31 14:24:37 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-07-31 14:24:37 (GMT)
commitc6ea8974e2d939223bfd6d64ee13ec89c090d2e0 (patch)
treeaf9793d4d928f7f37d632311d276bf914d5c355a /Objects/call.c
parenta568e5273382a5dca0c27274f7d8e34c41a87d4d (diff)
downloadcpython-c6ea8974e2d939223bfd6d64ee13ec89c090d2e0.zip
cpython-c6ea8974e2d939223bfd6d64ee13ec89c090d2e0.tar.gz
cpython-c6ea8974e2d939223bfd6d64ee13ec89c090d2e0.tar.bz2
bpo-30640: Fix undefined behavior in _PyFunction_FastCallDict() and PyEval_EvalCodeEx() (#2919)
k + 1 was calculated with k = NULL.
Diffstat (limited to 'Objects/call.c')
-rw-r--r--Objects/call.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/call.c b/Objects/call.c
index c3cc31d..3b08cb2 100644
--- a/Objects/call.c
+++ b/Objects/call.c
@@ -374,7 +374,7 @@ _PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs,
result = _PyEval_EvalCodeWithName((PyObject*)co, globals, (PyObject *)NULL,
args, nargs,
- k, k + 1, nk, 2,
+ k, k != NULL ? k + 1 : NULL, nk, 2,
d, nd, kwdefs,
closure, name, qualname);
Py_XDECREF(kwtuple);