mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 23:12:56 +00:00
[OSK] Validate the registry value data on query (#2050)
Ensure that the value data we query on loading the registry configuration settings matches with its data size
This commit is contained in:
parent
411a599610
commit
48d81f845d
1 changed files with 7 additions and 7 deletions
|
@ -16,7 +16,7 @@ BOOL LoadDataFromRegistry(VOID)
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
LONG lResult;
|
LONG lResult;
|
||||||
DWORD dwValue;
|
DWORD dwValue;
|
||||||
DWORD cbData = sizeof(DWORD);
|
DWORD cbData = sizeof(dwValue);
|
||||||
|
|
||||||
/* Initialize the registry application settings */
|
/* Initialize the registry application settings */
|
||||||
Globals.bShowWarning = TRUE;
|
Globals.bShowWarning = TRUE;
|
||||||
|
@ -49,7 +49,7 @@ BOOL LoadDataFromRegistry(VOID)
|
||||||
(BYTE *)&dwValue,
|
(BYTE *)&dwValue,
|
||||||
&cbData);
|
&cbData);
|
||||||
|
|
||||||
if (lResult != ERROR_SUCCESS)
|
if (lResult != ERROR_SUCCESS || cbData != sizeof(dwValue))
|
||||||
{
|
{
|
||||||
/* Bail out and return FALSE if we fail */
|
/* Bail out and return FALSE if we fail */
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
|
@ -67,7 +67,7 @@ BOOL LoadDataFromRegistry(VOID)
|
||||||
(BYTE *)&dwValue,
|
(BYTE *)&dwValue,
|
||||||
&cbData);
|
&cbData);
|
||||||
|
|
||||||
if (lResult != ERROR_SUCCESS)
|
if (lResult != ERROR_SUCCESS || cbData != sizeof(dwValue))
|
||||||
{
|
{
|
||||||
/* Bail out and return FALSE if we fail */
|
/* Bail out and return FALSE if we fail */
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
|
@ -85,7 +85,7 @@ BOOL LoadDataFromRegistry(VOID)
|
||||||
(BYTE *)&dwValue,
|
(BYTE *)&dwValue,
|
||||||
&cbData);
|
&cbData);
|
||||||
|
|
||||||
if (lResult != ERROR_SUCCESS)
|
if (lResult != ERROR_SUCCESS || cbData != sizeof(dwValue))
|
||||||
{
|
{
|
||||||
/* Bail out and return FALSE if we fail */
|
/* Bail out and return FALSE if we fail */
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
|
@ -103,7 +103,7 @@ BOOL LoadDataFromRegistry(VOID)
|
||||||
(BYTE *)&dwValue,
|
(BYTE *)&dwValue,
|
||||||
&cbData);
|
&cbData);
|
||||||
|
|
||||||
if (lResult != ERROR_SUCCESS)
|
if (lResult != ERROR_SUCCESS || cbData != sizeof(dwValue))
|
||||||
{
|
{
|
||||||
/* Bail out and return FALSE if we fail */
|
/* Bail out and return FALSE if we fail */
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
|
@ -120,7 +120,7 @@ BOOL LoadDataFromRegistry(VOID)
|
||||||
(BYTE *)&dwValue,
|
(BYTE *)&dwValue,
|
||||||
&cbData);
|
&cbData);
|
||||||
|
|
||||||
if (lResult != ERROR_SUCCESS)
|
if (lResult != ERROR_SUCCESS || cbData != sizeof(dwValue))
|
||||||
{
|
{
|
||||||
/* Bail out and return FALSE if we fail */
|
/* Bail out and return FALSE if we fail */
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
|
@ -137,7 +137,7 @@ BOOL LoadDataFromRegistry(VOID)
|
||||||
(BYTE *)&dwValue,
|
(BYTE *)&dwValue,
|
||||||
&cbData);
|
&cbData);
|
||||||
|
|
||||||
if (lResult != ERROR_SUCCESS)
|
if (lResult != ERROR_SUCCESS || cbData != sizeof(dwValue))
|
||||||
{
|
{
|
||||||
/* Bail out and return FALSE if we fail */
|
/* Bail out and return FALSE if we fail */
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue