From 009b8dd519cdef7bde42262b60579d8509c37ec2 Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg Date: Tue, 24 Apr 2007 00:05:47 +0200 Subject: [PATCH] localui: Avoid crash on NULL pointer. --- dlls/localui/localui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/localui/localui.c b/dlls/localui/localui.c index 36b28125949..2fd61c3444b 100644 --- a/dlls/localui/localui.c +++ b/dlls/localui/localui.c @@ -50,11 +50,11 @@ static LPWSTR strdupWW(LPCWSTR pPrefix, LPCWSTR pSuffix) LPWSTR ptr; DWORD len; - len = lstrlenW(pPrefix) + lstrlenW(pSuffix) + 1; + len = lstrlenW(pPrefix) + (pSuffix ? lstrlenW(pSuffix) : 0) + 1; ptr = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (ptr) { lstrcpyW(ptr, pPrefix); - lstrcatW(ptr, pSuffix); + if (pSuffix) lstrcatW(ptr, pSuffix); } return ptr; }