Dan Kegel : cmd: Size buffer in create_full_path() correctly.

Alexandre Julliard julliard at winehq.org
Wed Feb 3 09:33:03 CST 2010


Module: wine
Branch: master
Commit: 15998c2bdba386554b7e5f3e12d535d31bb9170c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=15998c2bdba386554b7e5f3e12d535d31bb9170c

Author: Dan Kegel <dank at kegel.com>
Date:   Tue Feb  2 17:42:01 2010 -0800

cmd: Size buffer in create_full_path() correctly.

---

 programs/cmd/builtins.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index c63360b..d1019cc 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -319,7 +319,7 @@ static BOOL create_full_path(WCHAR* path)
     WCHAR *new_path;
     BOOL ret = TRUE;
 
-    new_path = HeapAlloc(GetProcessHeap(),0,(strlenW(path) * sizeof(WCHAR))+1);
+    new_path = HeapAlloc(GetProcessHeap(),0,(strlenW(path)+1) * sizeof(WCHAR));
     strcpyW(new_path,path);
 
     while ((len = strlenW(new_path)) && new_path[len - 1] == '\\')




More information about the wine-cvs mailing list