[PATCH] reg: Avoid possible out-of-bounds memory access when a switch is only a forward slash or hyphen

Hugh McMaster hugh.mcmaster at outlook.com
Thu Jun 9 00:48:29 CDT 2016


Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 programs/reg/reg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/programs/reg/reg.c b/programs/reg/reg.c
index 7d9c972..20df2dd 100644
--- a/programs/reg/reg.c
+++ b/programs/reg/reg.c
@@ -937,7 +937,7 @@ int wmain(int argc, WCHAR *argvW[])
                 value_all = TRUE;
                 continue;
             }
-            else if (ptr[1])
+            else if (!ptr[0] || ptr[1])
             {
                 output_message(STRING_INVALID_CMDLINE);
                 return 1;
-- 
1.9.1




More information about the wine-patches mailing list