Module Name:    src
Committed By:   maxv
Date:           Fri Sep 20 11:29:47 UTC 2019

Modified Files:
        src/sys/dev/ic: an.c

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

Found by the lgtm bot.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/ic/an.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/an.c
diff -u src/sys/dev/ic/an.c:1.70 src/sys/dev/ic/an.c:1.71
--- src/sys/dev/ic/an.c:1.70	Tue Feb  5 06:17:02 2019
+++ src/sys/dev/ic/an.c	Fri Sep 20 11:29:47 2019
@@ -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 <wp...@ctr.columbia.edu>.  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 @@ an_set_nwkey_eap(struct an_softc *sc, st
 			 */
 			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);

Reply via email to