mirror of
https://github.com/reactos/reactos.git
synced 2024-08-04 18:40:59 +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)
|
if (dwType == REG_EXPAND_SZ)
|
||||||
{
|
{
|
||||||
cbData = ExpandEnvironmentStringsW(pvBuf, pvData,
|
cbData = ExpandEnvironmentStringsW(pvBuf, pvData,
|
||||||
pcbData ? *pcbData : 0);
|
pcbData ? (*pcbData)/sizeof(WCHAR) : 0);
|
||||||
dwType = REG_SZ;
|
dwType = REG_SZ;
|
||||||
if(pcbData && cbData > *pcbData)
|
if(pcbData && cbData > ((*pcbData)/sizeof(WCHAR)))
|
||||||
ret = ERROR_MORE_DATA;
|
ret = ERROR_MORE_DATA;
|
||||||
}
|
}
|
||||||
else if (pcbData)
|
else if (pcbData)
|
||||||
|
@ -814,7 +814,7 @@ SetupDiBuildDriverInfoList(
|
||||||
KEY_QUERY_VALUE);
|
KEY_QUERY_VALUE);
|
||||||
if (hDriverKey == INVALID_HANDLE_VALUE)
|
if (hDriverKey == INVALID_HANDLE_VALUE)
|
||||||
goto done;
|
goto done;
|
||||||
RequiredSize = len - strlenW(InfFileName);
|
RequiredSize = (len - strlenW(InfFileName)) * sizeof(WCHAR);
|
||||||
rc = RegGetValueW(
|
rc = RegGetValueW(
|
||||||
hDriverKey,
|
hDriverKey,
|
||||||
NULL,
|
NULL,
|
||||||
|
|
Loading…
Reference in a new issue