Commit 60e414fb authored by Alexandre Julliard's avatar Alexandre Julliard

Authors: Chris Morgan <cmorgan@wpi.edu>, James Abbatiello <abbejy@wpi.edu>

HEADER_InsertItemA and HEADER_InsertItemW now treat null pointers to text strings as null strings, as Windows does. Fixes wine crash on startup of CuteFTP.
parent 9adef53d
......@@ -762,6 +762,8 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
lpItem->cxy = phdi->cxy;
if (phdi->mask & HDI_TEXT) {
if (!phdi->pszText) /* null pointer check */
phdi->pszText = "";
if (phdi->pszText != LPSTR_TEXTCALLBACKA) {
len = lstrlenA (phdi->pszText);
lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
......@@ -846,6 +848,8 @@ HEADER_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
lpItem->cxy = phdi->cxy;
if (phdi->mask & HDI_TEXT) {
if (!phdi->pszText) /* null pointer check */
phdi->pszText = "";
if (phdi->pszText != LPSTR_TEXTCALLBACKW) {
len = lstrlenW (phdi->pszText);
lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
......
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