netapi32: Fix to prevent access beyond nul terminator.
This commit is contained in:
parent
4aca760126
commit
18549f3357
|
@ -1497,13 +1497,17 @@ void NetBTInit(void)
|
||||||
NetBTNameEncode */
|
NetBTNameEncode */
|
||||||
char *ptr, *lenPtr;
|
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;
|
if (*ptr == '.')
|
||||||
ptr - gScopeID < sizeof(gScopeID) && *ptr && *ptr != '.';
|
{
|
||||||
ptr++)
|
lenPtr = ptr;
|
||||||
*lenPtr += 1;
|
*lenPtr = 0;
|
||||||
ptr++;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
++*lenPtr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (RegQueryValueExW(hKey, CacheTimeoutW, NULL, NULL,
|
if (RegQueryValueExW(hKey, CacheTimeoutW, NULL, NULL,
|
||||||
|
|
Loading…
Reference in New Issue