Commit 47aaf09d authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

comctl32: Fixed TreeView_EndEditLabelNow crash.

parent 826e937a
......@@ -3793,7 +3793,8 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel)
if (strcmpW(newText, editedItem->pszText) != 0)
{
if (NULL == ReAlloc(editedItem->pszText, iLength + 1))
WCHAR *ptr = ReAlloc(editedItem->pszText, sizeof(WCHAR)*(iLength + 1));
if (ptr == NULL)
{
ERR("OutOfMemory, cannot allocate space for label\n");
DestroyWindow(infoPtr->hwndEdit);
......@@ -3802,6 +3803,7 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel)
}
else
{
editedItem->pszText = ptr;
editedItem->cchTextMax = iLength + 1;
strcpyW(editedItem->pszText, newText);
}
......
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