[PATCH 5/5] [cmd] Prevent overflow for long command string

Ann and Jason Edmeades jason at edmeades.me.uk
Mon Nov 19 18:36:28 CST 2012


If an individual parameter is longer than MAX_PATH characters,
an overflow occurs - for the syntax cmd.exe /c "<command line>"
the whole command line can be a single parameter during the
cmd.exe /c processing logic.

[Fixes bug 11073]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20121120/c0e87028/attachment.html>
-------------- next part --------------
From aa0d4d790fdb04dd8165f27b11cf31e8e160f90f Mon Sep 17 00:00:00 2001
From: Jason Edmeades <jason at edmeades.me.uk>
Date: Mon, 19 Nov 2012 22:34:09 +0000
Subject: [PATCH 5/5] [cmd] Prevent overflow for long command string

If an individual parameter is longer than MAX_PATH characters,
an overflow occurs - for the syntax cmd.exe /c "<command line>"
the whole command line can be a single parameter during the
cmd.exe /c processing logic.

[Fixes bug 11073]
---
 programs/cmd/batch.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c
index e9b98dc..8cd48e8 100644
--- a/programs/cmd/batch.c
+++ b/programs/cmd/batch.c
@@ -153,7 +153,7 @@ WCHAR *WCMD_parameter_with_delims (WCHAR *s, int n, WCHAR **start,
                                    BOOL raw, BOOL wholecmdline, const WCHAR *delims)
 {
     int curParamNb = 0;
-    static WCHAR param[MAX_PATH];
+    static WCHAR param[MAXSTRING];
     WCHAR *p = s, *begin;
 
     if (start != NULL) *start = NULL;
-- 
1.7.9.5


More information about the wine-patches mailing list