[Python-checkins] cpython: Re #18521: move array bounds check before array access.

georg.brandl python-checkins at python.org
Mon Oct 14 07:00:24 CEST 2013


http://hg.python.org/cpython/rev/63bc2fe28a6e
changeset:   86358:63bc2fe28a6e
user:        Georg Brandl <georg at python.org>
date:        Mon Oct 14 07:01:11 2013 +0200
summary:
  Re #18521: move array bounds check before array access.

files:
  Python/getargs.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Python/getargs.c b/Python/getargs.c
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -376,7 +376,7 @@
                           "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);

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list