Module: wine Branch: master Commit: d288d8d333f6faea9d64a0af944f125663a449d8 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d288d8d333f6faea9d64a0af94...
Author: Pierre Schweitzer pierre@reactos.org Date: Sun May 1 17:22:44 2016 +0200
comdlg32: Check for overflow before dereferencing.
Signed-off-by: Pierre Schweitzer pierre@reactos.org Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/comdlg32/filedlg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index 1453396..282582b 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -650,7 +650,7 @@ int COMDLG32_SplitFileNames(LPWSTR lpstrEdit, UINT nStrLen, LPWSTR *lpstrFileLis if ( lpstrEdit[nStrCharCount]=='"' ) { nStrCharCount++; - while ((lpstrEdit[nStrCharCount]!='"') && (nStrCharCount <= nStrLen)) + while ((nStrCharCount <= nStrLen) && (lpstrEdit[nStrCharCount]!='"')) { (*lpstrFileList)[nFileIndex++] = lpstrEdit[nStrCharCount]; nStrCharCount++;