Hugh McMaster : reg: Fail if /s is used without an accompanying argument.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 17 11:15:04 CST 2016


Module: wine
Branch: master
Commit: 46bdc153f129a32bd88eefc484d27db3e89ac881
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=46bdc153f129a32bd88eefc484d27db3e89ac881

Author: Hugh McMaster <hugh.mcmaster at outlook.com>
Date:   Wed Feb 17 23:41:05 2016 +1100

reg: Fail if /s is used without an accompanying argument.

Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/reg/reg.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/programs/reg/reg.c b/programs/reg/reg.c
index ef25fe5..bcd812a 100644
--- a/programs/reg/reg.c
+++ b/programs/reg/reg.c
@@ -576,7 +576,16 @@ int wmain(int argc, WCHAR *argvW[])
             else if (!lstrcmpiW(argvW[i], slashTW))
                 type = argvW[++i];
             else if (!lstrcmpiW(argvW[i], slashSW))
-                separator = argvW[++i][0];
+            {
+                WCHAR *ptr = argvW[++i];
+
+                if (!ptr)
+                {
+                    output_message(STRING_INVALID_CMDLINE);
+                    return 1;
+                }
+                separator = ptr[0];
+            }
             else if (!lstrcmpiW(argvW[i], slashDW))
             {
                 if (!(data = argvW[++i]))




More information about the wine-cvs mailing list