Commit 18549f33 authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

netapi32: Fix to prevent access beyond nul terminator.

parent 4aca7601
......@@ -1497,13 +1497,17 @@ void NetBTInit(void)
NetBTNameEncode */
char *ptr, *lenPtr;
for (ptr = gScopeID + 1; ptr - gScopeID < sizeof(gScopeID) && *ptr; )
for (ptr = gScopeID + 1, lenPtr = gScopeID; ptr - gScopeID < sizeof(gScopeID) && *ptr; ++ptr)
{
for (lenPtr = ptr - 1, *lenPtr = 0;
ptr - gScopeID < sizeof(gScopeID) && *ptr && *ptr != '.';
ptr++)
*lenPtr += 1;
ptr++;
if (*ptr == '.')
{
lenPtr = ptr;
*lenPtr = 0;
}
else
{
++*lenPtr;
}
}
}
if (RegQueryValueExW(hKey, CacheTimeoutW, NULL, NULL,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment