Changeset 22006


Ignore:
Timestamp:
Jul 19, 2012, 12:19:55 AM (13 years ago)
Author:
dmik
Message:

iphlpapi: Fix possible crash in GetAdaptersInfo() and friends.

This could happen under some circumstances due to invalid casting
from int to char. Regression of the switch to GCC (which performs
conversions differently compared to VAC).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/iphlpapi/iphlpapi.cpp

    r21916 r22006  
    7979{
    8080    sprintf(dst, "%u.%u.%u.%u",
    81             (char)data,
    82             (char)(*(((char*)&data) + 1)),
    83             (char)(*(((char*)&data) + 2)),
    84             (char)(*(((char*)&data) + 3)));
     81            data & 0xFF,
     82            (data >> 8) & 0xFF,
     83            (data >> 16) & 0xFF,
     84            (data >> 24) & 0xFF);
    8585}
    8686
Note: See TracChangeset for help on using the changeset viewer.