From: Thomas Faller Subject: [PATCH] cmd: Fix access of uninitialized memory Message-Id: <5579EC13.9070008@gmx.de> Date: Thu, 11 Jun 2015 22:14:11 +0200 Patch for https://bugs.winehq.org/show_bug.cgi?id=36163 --- programs/cmd/builtins.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 724da20..30b8684 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -3313,7 +3313,8 @@ void WCMD_setshow_default (const WCHAR *args) { WINE_TRACE("Request change to directory '%s'\n", wine_dbgstr_w(args)); /* Skip /D and trailing whitespace if on the front of the command line */ - if (CompareStringW(LOCALE_USER_DEFAULT, + if (strlenW(args) >= 2 && + CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, args, 2, parmD, -1) == CSTR_EQUAL) { args += 2;