summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-01-20 06:33:06 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-01-20 06:33:06 (GMT)
commit398ef5c08feabfdbf7d0b1e10817139f0e98eefd (patch)
tree313bc8288fb071b96270f05ce96bf19cc13f1358 /Python
parenta57a8a3e2d64dfff1bc843c8b34a6a5e06dbe595 (diff)
downloadcpython-398ef5c08feabfdbf7d0b1e10817139f0e98eefd.zip
cpython-398ef5c08feabfdbf7d0b1e10817139f0e98eefd.tar.gz
cpython-398ef5c08feabfdbf7d0b1e10817139f0e98eefd.tar.bz2
Issue #29327: Fixed a crash when pass the iterable keyword argument to sorted().
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 69e5f08..8acdfc3 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -2123,7 +2123,7 @@ builtin_sorted(PyObject *self, PyObject *args, PyObject *kwds)
{
PyObject *newlist, *v, *seq, *keyfunc=NULL, **newargs;
PyObject *callable;
- static char *kwlist[] = {"iterable", "key", "reverse", 0};
+ static char *kwlist[] = {"", "key", "reverse", 0};
int reverse;
Py_ssize_t nargs;
@@ -2142,6 +2142,7 @@ builtin_sorted(PyObject *self, PyObject *args, PyObject *kwds)
return NULL;
}
+ assert(PyTuple_GET_SIZE(args) >= 1);
newargs = &PyTuple_GET_ITEM(args, 1);
nargs = PyTuple_GET_SIZE(args) - 1;
v = _PyObject_FastCallDict(callable, newargs, nargs, kwds);