gh-110864: Fix _PyArg_UnpackKeywordsWithVararg overwriting vararg with NULL (#110868)

This commit is contained in:
Nikita Sobolev 2023-10-16 14:42:44 +03:00 committed by GitHub
parent db656aebc6
commit c2192a2bee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 130 additions and 2 deletions

View file

@ -2522,7 +2522,7 @@ _PyArg_UnpackKeywordsWithVararg(PyObject *const *args, Py_ssize_t nargs,
*
* Otherwise, we leave a place at `buf[vararg]` for vararg tuple
* so the index is `i + 1`. */
if (nargs < vararg) {
if (nargs < vararg && i != vararg) {
buf[i] = current_arg;
}
else {