Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6203962

Browse files
committed
Fix an array index out-of-bound bug
Variable `vararg` indicates the index of vararg in parameter list.While copying kwargs to `buf`, the index `i` should not add `vararg`, which leads to an out-of-bound bug.When there are positional args, vararg and keyword args in a function definition, in which case `vararg` > 1, this bug can be triggered.e.g.``` pos: object *args: object kw: object```
1 parent6793f38 commit6203962

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎Python/getargs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2571,7 +2571,7 @@ _PyArg_UnpackKeywordsWithVararg(PyObject *const *args, Py_ssize_t nargs,
25712571
current_arg=NULL;
25722572
}
25732573

2574-
buf[i+vararg+1]=current_arg;
2574+
buf[i+1]=current_arg;
25752575

25762576
if (current_arg) {
25772577
--nkwargs;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp