From f3ea345b2d37064acfd910b9b8285ca34de7ff8e Mon Sep 17 00:00:00 2001 From: James Hatheway Date: Fri, 12 Jan 2001 23:01:41 +0000 Subject: [PATCH] Guard against incoming string of NULL in WM_SETTEXT. --- controls/edit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controls/edit.c b/controls/edit.c index 491b317ef68..e0c4d274440 100644 --- a/controls/edit.c +++ b/controls/edit.c @@ -4467,11 +4467,11 @@ static void EDIT_WM_SetFont(WND *wnd, EDITSTATE *es, HFONT font, BOOL redraw) */ static void EDIT_WM_SetText(WND *wnd, EDITSTATE *es, LPARAM lParam, BOOL unicode) { - LPWSTR text; + LPWSTR text = NULL; if(unicode) text = (LPWSTR)lParam; - else + else if (lParam) { LPCSTR textA = (LPCSTR)lParam; INT countW = MultiByteToWideChar(CP_ACP, 0, textA, -1, NULL, 0);