[PATCH] xcopy: allocate more space for the W buffer (Coverity)

Marcus Meissner marcus at jet.franken.de
Sun Sep 29 07:23:04 CDT 2013


1099508 Wrong size argument

(should be twice the size of the A buffer)
---
 programs/xcopy/xcopy.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/programs/xcopy/xcopy.c b/programs/xcopy/xcopy.c
index f894b0e..e3312db 100644
--- a/programs/xcopy/xcopy.c
+++ b/programs/xcopy/xcopy.c
@@ -114,7 +114,7 @@ static int __cdecl XCOPY_wprintf(const WCHAR *format, ...) {
      */
 
     if (!output_bufW) output_bufW = HeapAlloc(GetProcessHeap(), 0,
-                                              MAX_WRITECONSOLE_SIZE);
+                                              MAX_WRITECONSOLE_SIZE*sizeof(WCHAR));
     if (!output_bufW) {
       WINE_FIXME("Out of memory - could not allocate 2 x 64K buffers\n");
       return 0;
-- 
1.7.10.4




More information about the wine-patches mailing list