From: Georg Brandl Date: Mon, 14 Oct 2013 05:01:11 +0000 (+0200) Subject: Re #18521: move array bounds check before array access. X-Git-Tag: v3.4.0a4~108 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=142ad666dc68e2b4309b859802c4e57734b97a94;p=thirdparty%2FPython%2Fcpython.git Re #18521: move array bounds check before array access. --- diff --git a/Python/getargs.c b/Python/getargs.c index 2c2628f9a128..9d727523201d 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);