comdlg32: Avoid possible NULL pointer dereference (Coverity).

This commit is contained in:
Kai Blin 2008-10-14 12:56:16 +02:00 committed by Alexandre Julliard
parent 4dceb1f8bf
commit 4ff3d9954e
1 changed files with 4 additions and 2 deletions

View File

@ -312,8 +312,10 @@ static void FD31_UpdateResult(const FD31_DATA *lfs, const WCHAR *tmpstr)
if (lenstr2 > 3)
tmpstr2[lenstr2++]='\\';
lstrcpynW(tmpstr2+lenstr2, tmpstr, BUFFILE-lenstr2);
if (ofnW->lpstrFile)
lstrcpynW(ofnW->lpstrFile, tmpstr2, ofnW->nMaxFile);
if (!ofnW->lpstrFile)
return;
lstrcpynW(ofnW->lpstrFile, tmpstr2, ofnW->nMaxFile);
/* set filename offset */
p = PathFindFileNameW(ofnW->lpstrFile);