[COMDLG32]
authorPierre Schweitzer <pierre@reactos.org>
Mon, 2 May 2016 17:45:39 +0000 (17:45 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Mon, 2 May 2016 17:45:39 +0000 (17:45 +0000)
Import Wine commit:
d288d8d333f6faea9d64a0af944f125663a449d8, Check for overflow before dereferencing.

svn path=/trunk/; revision=71234

reactos/dll/win32/comdlg32/filedlg.c

index ecd89c7..ea518b4 100644 (file)
@@ -621,7 +621,7 @@ int COMDLG32_SplitFileNames(LPWSTR lpstrEdit, UINT nStrLen, LPWSTR *lpstrFileLis
          if ( lpstrEdit[nStrCharCount]=='"' )
          {
            nStrCharCount++;
          if ( lpstrEdit[nStrCharCount]=='"' )
          {
            nStrCharCount++;
-           while ((lpstrEdit[nStrCharCount]!='"') && (nStrCharCount <= nStrLen))
+           while ((nStrCharCount <= nStrLen) && (lpstrEdit[nStrCharCount]!='"'))
            {
              (*lpstrFileList)[nFileIndex++] = lpstrEdit[nStrCharCount];
              nStrCharCount++;
            {
              (*lpstrFileList)[nFileIndex++] = lpstrEdit[nStrCharCount];
              nStrCharCount++;