Alexandre Julliard : atl: Fix off-by-one buffer allocation.
Alexandre Julliard
julliard at winehq.org
Mon Jun 28 11:01:18 CDT 2010
Module: wine
Branch: master
Commit: f71c4113bc33fd738ce493d021694f166d2ed27c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f71c4113bc33fd738ce493d021694f166d2ed27c
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Jun 28 11:44:40 2010 +0200
atl: Fix off-by-one buffer allocation.
---
dlls/atl/registrar.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/atl/registrar.c b/dlls/atl/registrar.c
index 70c1384..7076e35 100644
--- a/dlls/atl/registrar.c
+++ b/dlls/atl/registrar.c
@@ -549,7 +549,7 @@ static HRESULT WINAPI Registrar_AddReplacement(IRegistrar *iface, LPCOLESTR Key,
new_rep = HeapAlloc(GetProcessHeap(), 0, sizeof(rep_list));
new_rep->key_len = lstrlenW(Key);
- new_rep->key = HeapAlloc(GetProcessHeap(), 0, new_rep->key_len*sizeof(OLECHAR)+1);
+ new_rep->key = HeapAlloc(GetProcessHeap(), 0, (new_rep->key_len + 1) * sizeof(OLECHAR));
memcpy(new_rep->key, Key, (new_rep->key_len+1)*sizeof(OLECHAR));
len = lstrlenW(item)+1;
More information about the wine-cvs
mailing list