James Hawkins : advpack: Leave room for the NULL terminator in the working_dir string.

Alexandre Julliard julliard at wine.codeweavers.com
Fri May 5 12:11:02 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: b3347c49a1759699166ee1deba54c92160ddba6d
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=b3347c49a1759699166ee1deba54c92160ddba6d

Author: James Hawkins <truiken at gmail.com>
Date:   Fri Apr 28 20:02:48 2006 -0500

advpack: Leave room for the NULL terminator in the working_dir string.

---

 dlls/advpack/install.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/advpack/install.c b/dlls/advpack/install.c
index 1987b93..c4b89a7 100644
--- a/dlls/advpack/install.c
+++ b/dlls/advpack/install.c
@@ -306,11 +306,11 @@ HRESULT install_init(LPCWSTR inf_filenam
     }
     else
     {
-        len = lstrlenW(working_dir);
+        len = lstrlenW(working_dir) + 1;
         ptr = working_dir;
     }
 
-    info->working_dir = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
+    info->working_dir = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
     if (!info->working_dir)
         return E_OUTOFMEMORY;
 




More information about the wine-cvs mailing list