Commit 65016636 authored by Eric Kohl's avatar Eric Kohl Committed by Alexandre Julliard

Fixed pointer bugs in DPA_InsertPtr() and DPA_DeletePtr().

parent 8305ad50
...@@ -179,7 +179,7 @@ COMCTL32_ReAlloc (LPVOID lpSrc, DWORD dwSize) ...@@ -179,7 +179,7 @@ COMCTL32_ReAlloc (LPVOID lpSrc, DWORD dwSize)
/************************************************************************** /**************************************************************************
* Free [COMCTL32.73] * Free [COMCTL32.73]
.* *
* Frees an allocated memory block from the dll's private heap. * Frees an allocated memory block from the dll's private heap.
* *
* PARAMS * PARAMS
...@@ -1115,8 +1115,8 @@ DPA_InsertPtr (const HDPA hdpa, INT32 i, LPVOID p) ...@@ -1115,8 +1115,8 @@ DPA_InsertPtr (const HDPA hdpa, INT32 i, LPVOID p)
} }
else { else {
TRACE (commctrl, "-- inserting at %d\n", i); TRACE (commctrl, "-- inserting at %d\n", i);
lpTemp = hdpa->ptrs + (sizeof(LPVOID) * i); lpTemp = hdpa->ptrs + i;
lpDest = lpTemp + sizeof(LPVOID); lpDest = lpTemp + 1;
nSize = (hdpa->nItemCount - i) * sizeof(LPVOID); nSize = (hdpa->nItemCount - i) * sizeof(LPVOID);
TRACE (commctrl, "-- move dest=%p src=%p size=%x\n", TRACE (commctrl, "-- move dest=%p src=%p size=%x\n",
lpDest, lpTemp, nSize); lpDest, lpTemp, nSize);
...@@ -1216,8 +1216,8 @@ DPA_DeletePtr (const HDPA hdpa, INT32 i) ...@@ -1216,8 +1216,8 @@ DPA_DeletePtr (const HDPA hdpa, INT32 i)
/* do we need to move ?*/ /* do we need to move ?*/
if (i < hdpa->nItemCount - 1) { if (i < hdpa->nItemCount - 1) {
lpDest = hdpa->ptrs + (i * sizeof (LPVOID)); lpDest = hdpa->ptrs + i;
lpSrc = lpDest + sizeof(LPVOID); lpSrc = lpDest + 1;
nSize = (hdpa->nItemCount - i - 1) * sizeof(LPVOID); nSize = (hdpa->nItemCount - i - 1) * sizeof(LPVOID);
TRACE (commctrl,"-- move dest=%p src=%p size=%x\n", TRACE (commctrl,"-- move dest=%p src=%p size=%x\n",
lpDest, lpSrc, nSize); lpDest, lpSrc, nSize);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment