From 7d087d74d1e6e84fbd653e40f0c6847cc5395871 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Mon, 17 Oct 2005 15:17:54 +0000 Subject: [PATCH] fixed buffer overflow removed useless LocalUnlock fixed memory leak svn path=/trunk/; revision=18521 --- reactos/subsys/system/regedit/hexedit.c | 2 +- reactos/subsys/system/regedit/listview.c | 2 +- reactos/subsys/system/regedit/treeview.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/subsys/system/regedit/hexedit.c b/reactos/subsys/system/regedit/hexedit.c index dc231d4075e..4bf3ecc0d3e 100644 --- a/reactos/subsys/system/regedit/hexedit.c +++ b/reactos/subsys/system/regedit/hexedit.c @@ -517,7 +517,7 @@ HEXEDIT_WM_NCDESTROY(PHEXEDIT_DATA hed) { if(hed->hBuffer) { - while(LocalUnlock(hed->hBuffer)); + //while(LocalUnlock(hed->hBuffer)); LocalFree(hed->hBuffer); } diff --git a/reactos/subsys/system/regedit/listview.c b/reactos/subsys/system/regedit/listview.c index 84094bb9002..c88e26da5d5 100644 --- a/reactos/subsys/system/regedit/listview.c +++ b/reactos/subsys/system/regedit/listview.c @@ -223,7 +223,7 @@ static void AddEntryToList(HWND hwndLV, LPTSTR Name, DWORD dwValType, void* ValB LPTSTR strBinary; if(dwCount > 0) { - strBinary = HeapAlloc(GetProcessHeap(), 0, (dwCount * sizeof(TCHAR) * 3) + 1); + strBinary = HeapAlloc(GetProcessHeap(), 0, (dwCount * sizeof(TCHAR) * 3) + sizeof(TCHAR)); for (i = 0; i < dwCount; i++) { wsprintf( strBinary + i*3, _T("%02X "), pData[i] ); diff --git a/reactos/subsys/system/regedit/treeview.c b/reactos/subsys/system/regedit/treeview.c index 8f7544f628f..418ef8ed237 100644 --- a/reactos/subsys/system/regedit/treeview.c +++ b/reactos/subsys/system/regedit/treeview.c @@ -181,9 +181,9 @@ static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem) goto done; } tvItem.cchTextMax = dwMaxSubKeyLen; - if (!(tvItem.pszText = HeapAlloc(GetProcessHeap(), 0, dwMaxSubKeyLen * sizeof(TCHAR)))) { + /*if (!(tvItem.pszText = HeapAlloc(GetProcessHeap(), 0, dwMaxSubKeyLen * sizeof(TCHAR)))) { goto done; - } + }*/ /* Get all of the tree node siblings in one contiguous block of memory */ {