Jason Edmeades : cmd: Fix issue in WCMD_assoc highlighted by valgrind.

Alexandre Julliard julliard at winehq.org
Thu Jul 5 15:25:53 CDT 2018

Module: wine
Branch: master
Commit: ab46a89c3b8649844a70ee30abffbbd275128bc3
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ab46a89c3b8649844a70ee30abffbbd275128bc3

Author: Jason Edmeades <us at edmeades.me.uk>
Date:   Wed Jul  4 22:08:40 2018 +0100

cmd: Fix issue in WCMD_assoc highlighted by valgrind.

In an error condition, the wrong variable was being used for an insert,
resulting in a read from uninitialized data. This could be triggered for
example by 'ftype jason=', and the error message should have included
jason but instead was just ''.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=38849
Signed-off-by: Jason Edmeades <us at edmeades.me.uk>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>


 programs/cmd/builtins.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index 3a0981d..57a41c4 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -4923,7 +4923,7 @@ void WCMD_assoc (const WCHAR *args, BOOL assoc) {
               LoadStringW(hinst, WCMD_NOFTYPE, msgbuffer,
-            WCMD_output_stderr(msgbuffer, keyValue);
+            WCMD_output_stderr(msgbuffer, args);
             errorlevel = 2;

More information about the wine-cvs mailing list