mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Re #18521: move array bounds check before array access.
This commit is contained in:
parent
6083a4bc1c
commit
142ad666dc
1 changed files with 1 additions and 1 deletions
|
@ -376,7 +376,7 @@ seterror(Py_ssize_t iarg, const char *msg, int *levels, const char *fname,
|
||||||
"argument %" PY_FORMAT_SIZE_T "d", iarg);
|
"argument %" PY_FORMAT_SIZE_T "d", iarg);
|
||||||
i = 0;
|
i = 0;
|
||||||
p += strlen(p);
|
p += strlen(p);
|
||||||
while (levels[i] > 0 && i < 32 && (int)(p-buf) < 220) {
|
while (i < 32 && levels[i] > 0 && (int)(p-buf) < 220) {
|
||||||
PyOS_snprintf(p, sizeof(buf) - (p - buf),
|
PyOS_snprintf(p, sizeof(buf) - (p - buf),
|
||||||
", item %d", levels[i]-1);
|
", item %d", levels[i]-1);
|
||||||
p += strlen(p);
|
p += strlen(p);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue