Zac Brown : wininet: Fix FtpGetCurrentDirectoryW to handle bad input.
Alexandre Julliard
julliard at winehq.org
Mon Dec 3 09:18:00 CST 2007
Module: wine
Branch: master
Commit: b9b900f4b89f4225259b02482fb8d828fa693586
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b9b900f4b89f4225259b02482fb8d828fa693586
Author: Zac Brown <zac at zacbrown.org>
Date: Sat Dec 1 17:21:07 2007 -0500
wininet: Fix FtpGetCurrentDirectoryW to handle bad input.
---
dlls/wininet/ftp.c | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c
index 39fbc90..ce60fa0 100644
--- a/dlls/wininet/ftp.c
+++ b/dlls/wininet/ftp.c
@@ -885,12 +885,30 @@ 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 (NULL == lpwfs)
+ {
+ INTERNET_SetLastError(ERROR_INVALID_HANDLE);
+ goto lend;
+ }
+
+ if (WH_HFTPSESSION != lpwfs->hdr.htype)
{
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
goto lend;
}
+ if (!lpdwCurrentDirectory)
+ {
+ INTERNET_SetLastError(ERROR_INVALID_PARAMETER);
+ goto lend;
+ }
+
+ if (lpszCurrentDirectory == NULL)
+ {
+ INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER);
+ goto lend;
+ }
+
if (lpwfs->download_in_progress != NULL)
{
INTERNET_SetLastError(ERROR_FTP_TRANSFER_IN_PROGRESS);
More information about the wine-cvs
mailing list