diff options
author | Zackery Spytz <Osmunda46@gmail.com> | 2017-09-08 01:17:38 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-09-08 01:17:38 (GMT) |
commit | f032e9237aa7d43d21e0b04d685c36bddf7078c1 (patch) | |
tree | 230e38007523d7183966abc26d4a147a1de4928d /Python | |
parent | 645c1e421348790d49eab863279a41cb2b6a007a (diff) | |
download | cpython-f032e9237aa7d43d21e0b04d685c36bddf7078c1.zip cpython-f032e9237aa7d43d21e0b04d685c36bddf7078c1.tar.gz cpython-f032e9237aa7d43d21e0b04d685c36bddf7078c1.tar.bz2 |
[3.6] bpo-30640: Fix undefined behavior in _PyFunction_FastCallDict() and PyEval_EvalCodeEx() (GH-2919) (#2964)
k + 1 was calculated with k = NULL..
(cherry picked from commit c6ea8974e2d939223bfd6d64ee13ec89c090d2e0)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 8eb78bf..4aa3250 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4171,7 +4171,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); @@ -5053,7 +5054,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); |