mirror of
https://github.com/reactos/reactos.git
synced 2025-06-05 01:10:26 +00:00
[WINESYNC] 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> wine commit id b2ead1ffcc8d28b488b561e8c5a9e3cc964699a3 by Hugh McMaster <hugh.mcmaster@outlook.com>
This commit is contained in:
parent
6c0f70db4d
commit
0a5bdf825b
2 changed files with 39 additions and 37 deletions
|
@ -222,46 +222,48 @@ int reg_add(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;
|
||||||
|
|
||||||
|
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"))
|
switch (towlower(*str))
|
||||||
{
|
{
|
||||||
if (value_empty) goto invalid;
|
case 'v':
|
||||||
value_empty = TRUE;
|
if (value_name || !(value_name = argvW[++i]))
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else if (!str[0] || str[1])
|
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
break;
|
||||||
switch (towlower(*str))
|
case 't':
|
||||||
{
|
if (type || !(type = argvW[++i]))
|
||||||
case 'v':
|
|
||||||
if (value_name || !(value_name = argvW[++i]))
|
|
||||||
goto invalid;
|
|
||||||
break;
|
|
||||||
case 't':
|
|
||||||
if (type || !(type = argvW[++i]))
|
|
||||||
goto invalid;
|
|
||||||
break;
|
|
||||||
case 'd':
|
|
||||||
if (data || !(data = argvW[++i]))
|
|
||||||
goto invalid;
|
|
||||||
break;
|
|
||||||
case 's':
|
|
||||||
str = argvW[++i];
|
|
||||||
if (separator || !str || lstrlenW(str) != 1)
|
|
||||||
goto invalid;
|
|
||||||
separator = str[0];
|
|
||||||
break;
|
|
||||||
case 'f':
|
|
||||||
if (force) goto invalid;
|
|
||||||
force = TRUE;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
goto invalid;
|
goto invalid;
|
||||||
}
|
break;
|
||||||
|
case 'd':
|
||||||
|
if (data || !(data = argvW[++i]))
|
||||||
|
goto invalid;
|
||||||
|
break;
|
||||||
|
case 's':
|
||||||
|
str = argvW[++i];
|
||||||
|
if (separator || !str || lstrlenW(str) != 1)
|
||||||
|
goto invalid;
|
||||||
|
separator = str[0];
|
||||||
|
break;
|
||||||
|
case 'f':
|
||||||
|
if (force) goto invalid;
|
||||||
|
force = TRUE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
goto invalid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,4 +4,4 @@ directories:
|
||||||
files:
|
files:
|
||||||
programs/reg/resource.h: base/applications/cmdutils/reg/resource.h
|
programs/reg/resource.h: base/applications/cmdutils/reg/resource.h
|
||||||
tags:
|
tags:
|
||||||
wine: b80da20656feda99f9c6e749f5cd6d6f3c242cd3
|
wine: b2ead1ffcc8d28b488b561e8c5a9e3cc964699a3
|
||||||
|
|
Loading…
Reference in a new issue