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

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2021-04-02 22:26:53 +11:00 committed by Alexandre Julliard
parent dc57a265f1
commit b2ead1ffcc
1 changed files with 38 additions and 36 deletions

View File

@ -222,9 +222,12 @@ int reg_add(int argc, WCHAR *argvW[])
for (i = 3; i < argc; i++)
{
if (argvW[i][0] == '/' || argvW[i][0] == '-')
{
WCHAR *str = &argvW[i][1];
WCHAR *str;
if (argvW[i][0] != '/' && argvW[i][0] != '-')
goto invalid;
str = &argvW[i][1];
if (!lstrcmpiW(str, L"ve"))
{
@ -263,7 +266,6 @@ int reg_add(int argc, WCHAR *argvW[])
goto invalid;
}
}
}
if (value_name && value_empty)
goto invalid;