Commit 51e83dec authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

reg: Abort 'delete' operation when parsing command-line arguments that are not switches.

parent b2ead1ff
...@@ -118,9 +118,12 @@ int reg_delete(int argc, WCHAR *argvW[]) ...@@ -118,9 +118,12 @@ int reg_delete(int argc, WCHAR *argvW[])
for (i = 3; i < argc; i++) for (i = 3; i < argc; i++)
{ {
if (argvW[i][0] == '/' || argvW[i][0] == '-') WCHAR *str;
{
WCHAR *str = &argvW[i][1]; if (argvW[i][0] != '/' && argvW[i][0] != '-')
goto invalid;
str = &argvW[i][1];
if (!lstrcmpiW(str, L"va")) if (!lstrcmpiW(str, L"va"))
{ {
...@@ -151,7 +154,6 @@ int reg_delete(int argc, WCHAR *argvW[]) ...@@ -151,7 +154,6 @@ int reg_delete(int argc, WCHAR *argvW[])
goto invalid; goto invalid;
} }
} }
}
if ((value_name && value_empty) || (value_name && value_all) || (value_empty && value_all)) if ((value_name && value_empty) || (value_name && value_all) || (value_empty && value_all))
goto invalid; goto invalid;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment