comctl32/dsa: Handle overflow in DSA_InsertItem().

Signed-off-by: Xiaoshan Sun <sunxs@is.iscas.ac.cn>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Xiaoshan Sun 2016-07-24 14:44:40 +03:00 committed by Alexandre Julliard
parent 430108c92a
commit 0d57ff3d1f
1 changed files with 3 additions and 0 deletions

View File

@ -267,6 +267,9 @@ INT WINAPI DSA_InsertItem (HDSA hdsa, INT nIndex, LPVOID pSrc)
nNewItems = hdsa->nMaxCount + hdsa->nGrow;
nSize = hdsa->nItemSize * nNewItems;
if (nSize / hdsa->nItemSize != nNewItems)
return -1;
lpTemp = ReAlloc (hdsa->pData, nSize);
if (!lpTemp)
return -1;