From 72a27e6d4525d5a1e8b31b589bcd14663201519a Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Wed, 27 Mar 2024 17:36:48 +0900 Subject: [PATCH] [SHELL32] CQueryAssociation: Add slash check (#6676) Follow-up to #6656. I had forgotten to check the slash. JIRA issue: CORE-19493 Add StrChrW(pszAssoc, L'\\') check before PathFindExtensionW call. --- dll/win32/shell32/CQueryAssociations.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dll/win32/shell32/CQueryAssociations.cpp b/dll/win32/shell32/CQueryAssociations.cpp index 974ea5d22b4..f115a3d5a3d 100644 --- a/dll/win32/shell32/CQueryAssociations.cpp +++ b/dll/win32/shell32/CQueryAssociations.cpp @@ -98,9 +98,12 @@ HRESULT STDMETHODCALLTYPE CQueryAssociations::Init( HRESULT hr; LPCWSTR pchDotExt; - pchDotExt = PathFindExtensionW(pszAssoc); - if (pchDotExt && *pchDotExt) - pszAssoc = pchDotExt; + if (StrChrW(pszAssoc, L'\\')) + { + pchDotExt = PathFindExtensionW(pszAssoc); + if (pchDotExt && *pchDotExt) + pszAssoc = pchDotExt; + } LONG ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, pszAssoc,