mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 13:21:39 +00:00
[WINESYNC] reg: Abort 'query' 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> wine commit id 2c7d74594f2bd421f6d904f334171a198a13c66e by Hugh McMaster <hugh.mcmaster@outlook.com>
This commit is contained in:
parent
fa6d473e3d
commit
091880d29b
2 changed files with 26 additions and 24 deletions
|
@ -334,32 +334,34 @@ int reg_query(int argc, WCHAR *argvW[])
|
|||
|
||||
for (i = 3; i < argc; i++)
|
||||
{
|
||||
if (argvW[i][0] == '/' || argvW[i][0] == '-')
|
||||
WCHAR *str;
|
||||
|
||||
if (argvW[i][0] != '/' && argvW[i][0] != '-')
|
||||
goto invalid;
|
||||
|
||||
str = &argvW[i][1];
|
||||
|
||||
if (!lstrcmpiW(str, L"ve"))
|
||||
{
|
||||
WCHAR *str = &argvW[i][1];
|
||||
if (value_empty) goto invalid;
|
||||
value_empty = TRUE;
|
||||
continue;
|
||||
}
|
||||
else if (!str[0] || str[1])
|
||||
goto invalid;
|
||||
|
||||
if (!lstrcmpiW(str, L"ve"))
|
||||
{
|
||||
if (value_empty) goto invalid;
|
||||
value_empty = TRUE;
|
||||
continue;
|
||||
}
|
||||
else if (!str[0] || str[1])
|
||||
switch (towlower(*str))
|
||||
{
|
||||
case 'v':
|
||||
if (value_name || !(value_name = argvW[++i]))
|
||||
goto invalid;
|
||||
|
||||
switch (towlower(*str))
|
||||
{
|
||||
case 'v':
|
||||
if (value_name || !(value_name = argvW[++i]))
|
||||
goto invalid;
|
||||
break;
|
||||
case 's':
|
||||
if (recurse) goto invalid;
|
||||
recurse = TRUE;
|
||||
break;
|
||||
default:
|
||||
goto invalid;
|
||||
}
|
||||
break;
|
||||
case 's':
|
||||
if (recurse) goto invalid;
|
||||
recurse = TRUE;
|
||||
break;
|
||||
default:
|
||||
goto invalid;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue