Skip to content

Commit 8dce285

Browse files
committed
[UMPNPMGR] IsConsoleBoot(): Check for RegOpenKeyExW() failure before continuing
1 parent 98256a4 commit 8dce285

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎base/services/umpnpmgr/install.c‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,12 +476,13 @@ IsConsoleBoot(VOID)
476476
BOOL ConsoleBoot = FALSE;
477477
LONG rc;
478478

479-
rc = RegOpenKeyExW(
480-
HKEY_LOCAL_MACHINE,
481-
L"SYSTEM\\CurrentControlSet\\Control",
482-
0,
483-
KEY_QUERY_VALUE,
484-
&ControlKey);
479+
rc = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
480+
L"SYSTEM\\CurrentControlSet\\Control",
481+
0,
482+
KEY_QUERY_VALUE,
483+
&ControlKey);
484+
if (rc != ERROR_SUCCESS)
485+
goto cleanup;
485486

486487
rc = ReadRegSzKey(ControlKey, L"SystemStartOptions", &SystemStartOptions);
487488
if (rc != ERROR_SUCCESS)

0 commit comments

Comments
 (0)