SHLWAPI: don't read past end of table in PathFileExistsDefExtW

Mike McCormack mike at codeweavers.com
Thu Sep 2 12:29:42 CDT 2004


ChangeLog:
* don't read past end of table in PathFileExistsDefExtW
-------------- next part --------------
--- dlls/shlwapi/path.c.old	2004-09-03 02:18:20.000000000 +0900
+++ dlls/shlwapi/path.c	2004-09-03 02:18:24.000000000 +0900
@@ -1078,7 +1078,7 @@
       int iLen = lstrlenW(lpszPath);
       if (iLen > (MAX_PATH - 5))
         return FALSE;
-      while (dwWhich & 0x1 && iChoose < sizeof(pszExts))
+      while ( (dwWhich & 0x1) && pszExts[iChoose][0] )
       {
         lstrcpyW(lpszPath + iLen, pszExts[iChoose]);
         if (PathFileExistsW(lpszPath))


More information about the wine-patches mailing list