Alexandre Julliard : comdlg32: Fix path validation of UNC paths in the file dialog.

Alexandre Julliard julliard at winehq.org
Mon Sep 13 16:12:33 CDT 2021


Module: wine
Branch: master
Commit: c8e2802391b060a5ff7fe7b0f9db08fa186ad1c6
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=c8e2802391b060a5ff7fe7b0f9db08fa186ad1c6

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Sep 13 17:47:48 2021 +0200

comdlg32: Fix path validation of UNC paths in the file dialog.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comdlg32/filedlg.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c
index 0ada09aad96..0f74c85fcd8 100644
--- a/dlls/comdlg32/filedlg.c
+++ b/dlls/comdlg32/filedlg.c
@@ -2454,11 +2454,16 @@ int FILEDLG95_ValidatePathAction(LPWSTR lpstrPathAndFile, IShellFolder **ppsf,
         LPWSTR p;
 
         lstrcpyW(lpwstrTemp, lpszTemp);
-        p = PathFindNextComponentW(lpwstrTemp);
-
-        if (!p) break; /* end of path */
-
-        *p = 0;
+        if (lpszTemp == lpstrPathAndFile && (p = PathSkipRootW(lpwstrTemp)))
+        {
+            *p = 0;
+        }
+        else
+        {
+            p = PathFindNextComponentW(lpwstrTemp);
+            if (!p) break; /* end of path */
+            *p = 0;
+        }
         lpszTemp = lpszTemp + lstrlenW(lpwstrTemp);
 
         /* There are no wildcards when OFN_NOVALIDATE is set */




More information about the wine-cvs mailing list