Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 142ad66

Browse files
committed
Re #18521: move array bounds check before array access.
1 parent 6083a4b commit 142ad66

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/getargs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ seterror(Py_ssize_t iarg, const char *msg, int *levels, const char *fname,
376376
"argument %" PY_FORMAT_SIZE_T "d", iarg);
377377
i = 0;
378378
p += strlen(p);
379-
while (levels[i] > 0 && i < 32 && (int)(p-buf) < 220) {
379+
while (i < 32 && levels[i] > 0 && (int)(p-buf) < 220) {
380380
PyOS_snprintf(p, sizeof(buf) - (p - buf),
381381
", item %d", levels[i]-1);
382382
p += strlen(p);

0 commit comments

Comments
 (0)