[Bug 37122] New: PVS-Studio Error: One counter for two loops

wine-bugs at winehq.org wine-bugs at winehq.org
Sat Aug 16 13:18:12 CDT 2014


https://bugs.winehq.org/show_bug.cgi?id=37122

            Bug ID: 37122
           Summary: PVS-Studio Error: One counter for two loops
           Product: Wine
           Version: 1.7.22
          Hardware: x86-64
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: -unknown
          Assignee: wine-bugs at winehq.org
          Reporter: lukebenes at hotmail.com

PVS-Studio identifies a V535 Error, one counter for two loops. The variable 'i'
is being used for this loop and for the outer loop. Check lines: 980, 1003.
iphlpapi_main.c 1003

...
for (i = 0; i < num_v6addrs; i++)    //<==
{
    ...
    for (i = 0; i < 8 && !done; i++) //<==
    {
        ...
    }
    ...
    if (i < num_v6addrs - 1)
    {
        prefix->Next = (IP_ADAPTER_PREFIX *)ptr;
        prefix = prefix->Next;
    }
}
...

This fragment is suspicious: a nested loop is organized through the i variable
which is also used in the external loop.

details on the V535 error here: http://www.viva64.com/en/d/0124/

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list