summaryrefslogtreecommitdiffstats
path: root/Python/ceval.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 /Python/ceval.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 'Python/ceval.c')
-rw-r--r--Python/ceval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 59fc070..dd90e18 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4220,7 +4220,8 @@ PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals,
{
return _PyEval_EvalCodeWithName(_co, globals, locals,
args, argcount,
- kws, kws + 1, kwcount, 2,
+ kws, kws != NULL ? kws + 1 : NULL,
+ kwcount, 2,
defs, defcount,
kwdefs, closure,
NULL, NULL);