From: Fabian Maurer <dark.shadow4(a)web.de> Should not change the logic, but makes Coverity happy and seems safer Signed-off-by: Fabian Maurer <dark.shadow4(a)web.de> --- dlls/localui/localui.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/localui/localui.c b/dlls/localui/localui.c index 643b01d7b3f..5823fc88fa4 100644 --- a/dlls/localui/localui.c +++ b/dlls/localui/localui.c @@ -85,8 +85,10 @@ static BOOL dlg_configure_com(HANDLE hXcv, HWND hWnd, PCWSTR pPortName) DWORD len; BOOL res; - /* strip the colon (pPortName is never empty here) */ + /* strip the colon (pPortName should never empty be here) */ len = lstrlenW(pPortName); + if (!len) + return FALSE; shortname = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (shortname) { memcpy(shortname, pPortName, (len -1) * sizeof(WCHAR)); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1773