aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/getargs.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/getargs.c')
-rw-r--r--Python/getargs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index 330f2b456b3..3fab3b5efef 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -2552,7 +2552,8 @@ _PyArg_UnpackKeywordsWithVararg(PyObject *const *args, Py_ssize_t nargs,
}
/* copy keyword args using kwtuple to drive process */
- for (i = Py_MAX((int)nargs, posonly) - varargssize; i < maxargs; i++) {
+ for (i = Py_MAX((int)nargs, posonly) -
+ Py_SAFE_DOWNCAST(varargssize, Py_ssize_t, int); i < maxargs; i++) {
if (nkwargs) {
keyword = PyTuple_GET_ITEM(kwtuple, i - posonly);
if (kwargs != NULL) {