comdlg32: Check for overflow before dereferencing.

Signed-off-by: Pierre Schweitzer <pierre@reactos.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Pierre Schweitzer 2016-05-01 17:22:44 +02:00 committed by Alexandre Julliard
parent 1c31ba252c
commit d288d8d333
1 changed files with 1 additions and 1 deletions

View File

@ -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++;