mirror of
https://github.com/reactos/reactos.git
synced 2024-07-06 12:45:16 +00:00
[SETUPAPI]
- fix confusion on buffer size between string length and number of bytes. Might fix some infamous heap corruption bug during install. Please test. svn path=/trunk/; revision=53160
This commit is contained in:
parent
73386b2c5c
commit
5a88d3050f
|
@ -681,9 +681,9 @@ RegGetValueW( HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue,
|
|||
if (dwType == REG_EXPAND_SZ)
|
||||
{
|
||||
cbData = ExpandEnvironmentStringsW(pvBuf, pvData,
|
||||
pcbData ? *pcbData : 0);
|
||||
pcbData ? (*pcbData)/sizeof(WCHAR) : 0);
|
||||
dwType = REG_SZ;
|
||||
if(pcbData && cbData > *pcbData)
|
||||
if(pcbData && cbData > ((*pcbData)/sizeof(WCHAR)))
|
||||
ret = ERROR_MORE_DATA;
|
||||
}
|
||||
else if (pcbData)
|
||||
|
@ -814,7 +814,7 @@ SetupDiBuildDriverInfoList(
|
|||
KEY_QUERY_VALUE);
|
||||
if (hDriverKey == INVALID_HANDLE_VALUE)
|
||||
goto done;
|
||||
RequiredSize = len - strlenW(InfFileName);
|
||||
RequiredSize = (len - strlenW(InfFileName)) * sizeof(WCHAR);
|
||||
rc = RegGetValueW(
|
||||
hDriverKey,
|
||||
NULL,
|
||||
|
|
Loading…
Reference in a new issue