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

Alexandre Julliard julliard at winehq.org
Tue Mar 23 15:07:42 CDT 2021


Module: wine
Branch: oldstable
Commit: 79c48e7196cb01b6aabdcdacddd172220428283f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=79c48e7196cb01b6aabdcdacddd172220428283f

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>
(cherry picked from commit abe848f05f5d91d4c8eb875ebbf143ca9ca9a210)
Signed-off-by: Michael Stefaniuc <mstefani 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 f494b80ae2f..b4d10613929 100644
--- a/programs/cmd/batch.c
+++ b/programs/cmd/batch.c
@@ -395,8 +395,8 @@ void WCMD_HandleTildaModifiers(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