Damjan Jovanovic : cmd.exe: Increase size of WCMD_HandleTildeModifiers() buffers to MAXSTRING.

Alexandre Julliard julliard at winehq.org
Tue Nov 17 15:04:08 CST 2020


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

Author: Damjan Jovanovic <damjan.jov at gmail.com>
Date:   Fri Nov 13 18:09:59 2020 +0200

cmd.exe: Increase size of WCMD_HandleTildeModifiers() buffers to MAXSTRING.

Some buffers in WCMD_HandleTildeModifiers() are only of size MAX_PATH,
even though they handle strings that aren't necessarily
filenames. When changed to have size MAXSTRING, a stack overflow crash
with strings of size MAX_PATH stops happening.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42731
Signed-off-by: Damjan Jovanovic <damjan.jov at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/cmd/batch.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c
index 3aa40874aea..a08648d8c26 100644
--- a/programs/cmd/batch.c
+++ b/programs/cmd/batch.c
@@ -342,8 +342,8 @@ void WCMD_HandleTildeModifiers(WCHAR **start, BOOL atExecute)
   };
 
   WIN32_FILE_ATTRIBUTE_DATA fileInfo;
-  WCHAR  outputparam[MAX_PATH];
-  WCHAR  finaloutput[MAX_PATH];
+  WCHAR  outputparam[MAXSTRING];
+  WCHAR  finaloutput[MAXSTRING];
   WCHAR  fullfilename[MAX_PATH];
   WCHAR  thisoutput[MAX_PATH];
   WCHAR  *filepart       = NULL;




More information about the wine-cvs mailing list