If there are more than 8 interfaces on the computer, the loop condition may still be fulfilled, while the if clause in the loop is never called:
pAddress = pAdapter->FirstUnicastAddress;
while (pAddress != NULL)
{
/* store interface information if address will fit into output array */
if (addrCnt < *pAddrCnt)
{
...
/* increment number of addresses stored */
addrCnt++;
pAddress = pAddress->Next;
}
}
addrCnt can then be 8, but pAdress would still not be NULL
Tested on Devices with more than 8 Interfaces