diff --git a/controls/combo.c b/controls/combo.c index 21183ac958..f09969a27e 100644 --- a/controls/combo.c +++ b/controls/combo.c @@ -747,7 +747,8 @@ static void CBPaintText( size = SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, id, 0); if( (pText = HeapAlloc( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR))) ) { - SendMessageW(lphc->hWndLBox, LB_GETTEXT, (WPARAM)id, (LPARAM)pText); + /* size from LB_GETTEXTLEN may be too large, from LB_GETTEXT is accurate */ + size=SendMessageW(lphc->hWndLBox, LB_GETTEXT, (WPARAM)id, (LPARAM)pText); pText[size] = '\0'; /* just in case */ } else return; }