Commit 378dec15 authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

Fix the case where lpszSearchFile is NULL in FtpFindFirstFile.

parent 773784ea
......@@ -606,7 +606,7 @@ HINTERNET WINAPI FtpFindFirstFileW(HINTERNET hConnect,
workRequest.asyncall = FTPFINDFIRSTFILEW;
workRequest.handle = hConnect;
req = &workRequest.u.FtpFindFirstFileW;
req->lpszSearchFile = WININET_strdupW(lpszSearchFile);
req->lpszSearchFile = (lpszSearchFile == NULL) ? NULL : WININET_strdupW(lpszSearchFile);
req->lpFindFileData = lpFindFileData;
req->dwFlags = dwFlags;
req->dwContext= dwContext;
......@@ -2659,7 +2659,7 @@ HINTERNET FTP_ReceiveFileList(LPWININETFTPSESSIONW lpwfs, INT nSocket, LPCWSTR l
LPWININETFINDNEXTW lpwfn = NULL;
HINTERNET handle = 0;
TRACE("(%p,%d,%p,%ld)\n", lpwfs, nSocket, lpFindFileData, dwContext);
TRACE("(%p,%d,%s,%p,%ld)\n", lpwfs, nSocket, debugstr_w(lpszSearchFile), lpFindFileData, dwContext);
if (FTP_ParseDirectory(lpwfs, nSocket, lpszSearchFile, &lpafp, &dwSize))
{
......@@ -2878,7 +2878,8 @@ BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERTIESW lp
}
if(lpfp->lpszName) {
if(PathMatchSpecW(lpfp->lpszName, lpszSearchFile)) {
if((lpszSearchFile == NULL) ||
(PathMatchSpecW(lpfp->lpszName, lpszSearchFile))) {
found = TRUE;
TRACE("Matched: %s\n", debugstr_w(lpfp->lpszName));
}
......
......@@ -2556,7 +2556,8 @@ VOID INTERNET_ExecuteWork()
req = &workRequest.u.FtpFindFirstFileW;
FTP_FtpFindFirstFileW(workRequest.handle, req->lpszSearchFile,
req->lpFindFileData, req->dwFlags, req->dwContext);
HeapFree(GetProcessHeap(), 0, req->lpszSearchFile);
if (req->lpszSearchFile != NULL)
HeapFree(GetProcessHeap(), 0, req->lpszSearchFile);
}
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment