From eb8cac0f08312b83cf7607925ca0e5996e35499b Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 30 Oct 2023 17:30:43 +0100 Subject: [PATCH] shell32: Fix string size condition check (Coverity). The issue was introduced by 68fd74e7f9bdd2310aebeb59bc86754271cdc063. --- dlls/shell32/shlexec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index e0a768012e6..eb9ca4a06df 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -164,8 +164,8 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp case 'l': case 'L': if (lpFile) { - if ((size = SearchPathW(NULL, lpFile, L".exe", ARRAY_SIZE(xlpFile), xlpFile, NULL) - && size <= ARRAY_SIZE(xlpFile))) + size = SearchPathW(NULL, lpFile, L".exe", ARRAY_SIZE(xlpFile), xlpFile, NULL); + if (size && size <= ARRAY_SIZE(xlpFile)) cmd = xlpFile; else cmd = lpFile;