mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:35:47 +00:00
limit length of szValue to LF_FACESIZE to prevent a buffer overflow
initialize szValue svn path=/trunk/; revision=30599
This commit is contained in:
parent
28b9cdca2f
commit
78be83f3a8
1 changed files with 2 additions and 2 deletions
|
@ -506,7 +506,7 @@ GuiConsoleReadUserSettings(HKEY hKey, PCSRSS_CONSOLE Console, PGUI_CONSOLE_DATA
|
|||
DWORD dwValue;
|
||||
DWORD dwType;
|
||||
WCHAR szValueName[MAX_PATH];
|
||||
WCHAR szValue[MAX_PATH];
|
||||
WCHAR szValue[LF_FACESIZE] = L"\0";
|
||||
DWORD Value;
|
||||
|
||||
if (RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, NULL, NULL, &dwNumSubKeys, NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
|
||||
|
@ -530,7 +530,7 @@ GuiConsoleReadUserSettings(HKEY hKey, PCSRSS_CONSOLE Console, PGUI_CONSOLE_DATA
|
|||
* retry in case of string value
|
||||
*/
|
||||
dwValue = sizeof(szValue);
|
||||
dwValueName = MAX_PATH;
|
||||
dwValueName = LF_FACESIZE;
|
||||
if (RegEnumValueW(hKey, dwIndex, szValueName, &dwValueName, NULL, NULL, (BYTE*)szValue, &dwValue) != ERROR_SUCCESS)
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue