From 35f0965c431fe800594384e161ea64e1f354330e Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Fri, 12 May 2006 00:47:52 +0900 Subject: [PATCH] wininet: Check for null parameters in FtpSetCurrentDirectoryW. --- dlls/wininet/ftp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c index aa254f61cb2..5fde83dfec5 100644 --- a/dlls/wininet/ftp.c +++ b/dlls/wininet/ftp.c @@ -339,10 +339,16 @@ BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) */ BOOL WINAPI FtpSetCurrentDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory) { - LPWININETFTPSESSIONW lpwfs; + LPWININETFTPSESSIONW lpwfs = NULL; LPWININETAPPINFOW hIC = NULL; BOOL r = FALSE; + if (!lpszDirectory) + { + SetLastError(ERROR_INVALID_PARAMETER); + goto lend; + } + lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hConnect ); if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype) {