Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Don't use the same iterator in a nested loop. (Ho...



details:   https://anonhg.NetBSD.org/src/rev/872ad24a2836
branches:  trunk
changeset: 454523:872ad24a2836
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Sep 20 11:29:47 2019 +0000

description:
Don't use the same iterator in a nested loop. (How could this work?)

Found by the lgtm bot.

diffstat:

 sys/dev/ic/an.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r 31e5e92878c8 -r 872ad24a2836 sys/dev/ic/an.c
--- a/sys/dev/ic/an.c   Fri Sep 20 11:09:43 2019 +0000
+++ b/sys/dev/ic/an.c   Fri Sep 20 11:29:47 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: an.c,v 1.70 2019/02/05 06:17:02 msaitoh Exp $  */
+/*     $NetBSD: an.c,v 1.71 2019/09/20 11:29:47 maxv Exp $     */
 /*
  * Copyright (c) 1997, 1998, 1999
  *     Bill Paul <wpaul%ctr.columbia.edu@localhost>.  All rights reserved.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.70 2019/02/05 06:17:02 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.71 2019/09/20 11:29:47 maxv Exp $");
 
 
 #include <sys/param.h>
@@ -1240,8 +1240,9 @@
                         */
                        memset(unibuf, 0, sizeof(unibuf));
                        /* XXX: convert password to unicode */
-                       for (i = 0; i < len; i++)
-                               unibuf[i] = key->an_key[i];
+                       int j;
+                       for (j = 0; j < len; j++)
+                               unibuf[j] = key->an_key[j];
                        /* set PasswordHash */
                        MD4Init(&ctx);
                        MD4Update(&ctx, (u_int8_t *)unibuf, len * 2);



Home | Main Index | Thread Index | Old Index