Skip to content

Commit

Permalink
reg: Validate the registry key before commencing the export operation.
Browse files Browse the repository at this point in the history
Signed-off-by: Hugh McMaster <[email protected]>
Signed-off-by: Alexandre Julliard <[email protected]>
  • Loading branch information
hughmcmaster authored and julliard committed Dec 4, 2017
1 parent e0aadc0 commit 1749401
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion programs/reg/export.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static BOOL is_overwrite_switch(const WCHAR *s)

int reg_export(int argc, WCHAR *argv[])
{
HKEY root;
HKEY root, hkey;
WCHAR *path, *long_key;

if (argc == 3 || argc > 5)
Expand All @@ -50,7 +50,16 @@ int reg_export(int argc, WCHAR *argv[])
if (argc == 5 && !is_overwrite_switch(argv[4]))
goto error;

if (RegOpenKeyExW(root, path, 0, KEY_READ, &hkey))
{
output_message(STRING_INVALID_KEY);
return 1;
}

FIXME(": operation not yet implemented\n");

RegCloseKey(hkey);

return 1;

error:
Expand Down

0 comments on commit 1749401

Please sign in to comment.