wininet [2/2]: Fix error checking for FtpGetCurrentDirectoryW
Zac Brown
zac at zacbrown.org
Wed Nov 28 22:52:25 CST 2007
Hi,
Changelog:
* Fixed errors in error checking in FtpGetCurrentDirectoryW in wininet/ftp.c
diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c
index 39fbc90..4c8589b 100644
--- a/dlls/wininet/ftp.c
+++ b/dlls/wininet/ftp.c
@@ -885,13 +885,19 @@ BOOL WINAPI FtpGetCurrentDirectoryW(HINTERNET hFtpSession, LPWSTR lpszCurrentDir
TRACE("len(%d)\n", *lpdwCurrentDirectory);
lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hFtpSession );
- if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype)
+ if ( lpwfs == NULL || WH_HFTPSESSION != lpwfs->hdr.htype )
{
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
goto lend;
}
- if (lpwfs->download_in_progress != NULL)
+ if ( lpszCurrentDirectory == NULL || *lpdwCurrentDirectory == NULL )
+ {
+ INTERNET_SetLastError(ERROR_INVALID_PARAMETER);
+ goto lend;
+ }
+
+ if (lpwfs->download_in_progress != NULL)
{
INTERNET_SetLastError(ERROR_FTP_TRANSFER_IN_PROGRESS);
goto lend;
--
1.5.2.5
More information about the wine-patches
mailing list