wininet: Check for null parameters in FtpSetCurrentDirectoryW.

This commit is contained in:
Mike McCormack 2006-05-12 00:47:52 +09:00 committed by Alexandre Julliard
parent 5fb6e0ef16
commit 35f0965c43
1 changed files with 7 additions and 1 deletions

View File

@ -339,10 +339,16 @@ BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
*/ */
BOOL WINAPI FtpSetCurrentDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory) BOOL WINAPI FtpSetCurrentDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory)
{ {
LPWININETFTPSESSIONW lpwfs; LPWININETFTPSESSIONW lpwfs = NULL;
LPWININETAPPINFOW hIC = NULL; LPWININETAPPINFOW hIC = NULL;
BOOL r = FALSE; BOOL r = FALSE;
if (!lpszDirectory)
{
SetLastError(ERROR_INVALID_PARAMETER);
goto lend;
}
lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hConnect ); lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hConnect );
if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype) if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype)
{ {