PVS-StudioWarnings

PVS-Studio warning V535 for Wine

Nov 27th, 2014
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. static ULONG adapterAddressesFromIndex(....)
  2. {
  3.   ....
  4.   for (i = 0; i < num_v6addrs; i++)    //<==
  5.   {
  6.     ....
  7.     for (i = 0; i < 8 && !done; i++)   //<==
  8.     {
  9.       ....
  10.     }
  11.     ....
  12.     if (i < num_v6addrs - 1)
  13.     {
  14.       prefix->Next = (IP_ADAPTER_PREFIX *)ptr;
  15.       prefix = prefix->Next;
  16.     }
  17.   }
  18.   ....
  19. }
  20.  
  21. This suspicious code was found in Wine project by PVS-Studio static code analyzer.
  22. Warning message is:
  23. V535 The variable 'i' is being used for this loop and for the outer loop. Check lines: 980, 1003. iphlpapi_main.c 1003
  24.  
  25. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment