Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Mar 2017 18:29:23 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r315278 - head/sys/compat/linux
Message-ID:  <201703141829.v2EITNSY080407@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Tue Mar 14 18:29:23 2017
New Revision: 315278
URL: https://svnweb.freebsd.org/changeset/base/315278

Log:
  Fix usage of the same 'i' variable in the external and nested loops.
  
  Submitted by: Svyatoslav <razmyslov at viva64.com>
  Sponsored by: PVS-Studio
  
  MFC after:	1 week

Modified:
  head/sys/compat/linux/linux_vdso.c

Modified: head/sys/compat/linux/linux_vdso.c
==============================================================================
--- head/sys/compat/linux/linux_vdso.c	Tue Mar 14 18:27:48 2017	(r315277)
+++ head/sys/compat/linux/linux_vdso.c	Tue Mar 14 18:29:23 2017	(r315278)
@@ -147,7 +147,7 @@ __elfN(linux_vdso_reloc)(struct sysentve
 	Elf_Shdr *shdr;
 	Elf_Dyn *dyn;
 	Elf_Sym *sym;
-	int i, symcnt;
+	int i, j, symcnt;
 
 	ehdr = (Elf_Ehdr *) sv->sv_sigcode;
 
@@ -205,7 +205,7 @@ __elfN(linux_vdso_reloc)(struct sysentve
 			sym = (Elf_Sym *)((caddr_t)ehdr + shdr[i].sh_offset);
 			symcnt = shdr[i].sh_size / sizeof(*sym);
 
-			for(i = 0; i < symcnt; i++, sym++) {
+			for(j = 0; j < symcnt; j++, sym++) {
 				if (sym->st_shndx == SHN_UNDEF ||
 				    sym->st_shndx == SHN_ABS)
 					continue;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703141829.v2EITNSY080407>