Fixed off by one allocation error (DPA and DSA).

This commit is contained in:
Eric Pouech 1999-09-13 15:11:02 +00:00 committed by Alexandre Julliard
parent 54d44d468c
commit 200f8921b1
1 changed files with 2 additions and 2 deletions

View File

@ -843,7 +843,7 @@ DSA_SetItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
else {
/* resize the block of memory */
nNewItems =
hdsa->nGrow * ((INT)((nIndex - 1) / hdsa->nGrow) + 1);
hdsa->nGrow * ((INT)(((nIndex + 1) - 1) / hdsa->nGrow) + 1);
nSize = hdsa->nItemSize * nNewItems;
lpTemp = (LPVOID)COMCTL32_ReAlloc (hdsa->pData, nSize);
@ -1349,7 +1349,7 @@ DPA_SetPtr (const HDPA hdpa, INT i, LPVOID p)
else {
/* resize the block of memory */
INT nNewItems =
hdpa->nGrow * ((INT)((i - 1) / hdpa->nGrow) + 1);
hdpa->nGrow * ((INT)(((i+1) - 1) / hdpa->nGrow) + 1);
INT nSize = nNewItems * sizeof(LPVOID);
lpTemp = (LPVOID*)HeapReAlloc (hdpa->hHeap, HEAP_ZERO_MEMORY,