summaryrefslogtreecommitdiffstats
path: root/Python/getargs.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2013-10-14 05:01:11 (GMT)
committerGeorg Brandl <georg@python.org>2013-10-14 05:01:11 (GMT)
commit142ad666dc68e2b4309b859802c4e57734b97a94 (patch)
tree11f58bf6b26b95dea62d8172fd11d395544f0e5f /Python/getargs.c
parent6083a4bc1c64b7b07cbfc611f8bf38c75a5eebcf (diff)
downloadcpython-142ad666dc68e2b4309b859802c4e57734b97a94.zip
cpython-142ad666dc68e2b4309b859802c4e57734b97a94.tar.gz
cpython-142ad666dc68e2b4309b859802c4e57734b97a94.tar.bz2
Re #18521: move array bounds check before array access.
Diffstat (limited to 'Python/getargs.c')
-rw-r--r--Python/getargs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index 2c2628f..9d72752 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -376,7 +376,7 @@ seterror(Py_ssize_t iarg, const char *msg, int *levels, const char *fname,
"argument %" PY_FORMAT_SIZE_T "d", iarg);
i = 0;
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),
", item %d", levels[i]-1);
p += strlen(p);