wininet: Validate InternetGetLastResponseInfo() parameters.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com> Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5605e63cc1
commit
88e7ad5ab5
2 changed files with 17 additions and 0 deletions
dlls/wininet
|
@ -1085,6 +1085,11 @@ BOOL WINAPI InternetGetLastResponseInfoA(LPDWORD lpdwError,
|
|||
|
||||
TRACE("(%p, %p, %p)\n", lpdwError, lpszBuffer, lpdwBufferLength);
|
||||
|
||||
if (!lpdwError || !lpdwBufferLength)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
if (lpwite)
|
||||
{
|
||||
*lpdwError = lpwite->dwError;
|
||||
|
@ -1122,6 +1127,11 @@ BOOL WINAPI InternetGetLastResponseInfoW(LPDWORD lpdwError,
|
|||
|
||||
TRACE("(%p, %p, %p)\n", lpdwError, lpszBuffer, lpdwBufferLength);
|
||||
|
||||
if (!lpdwError || !lpdwBufferLength)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
return FALSE;
|
||||
}
|
||||
if (lpwite)
|
||||
{
|
||||
*lpdwError = lpwite->dwError;
|
||||
|
|
|
@ -738,12 +738,19 @@ static void test_command(HINTERNET hFtp)
|
|||
|
||||
for (i = 0; i < ARRAY_SIZE(command_test); i++)
|
||||
{
|
||||
DWORD size;
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = pFtpCommandA(hFtp, FALSE, FTP_TRANSFER_TYPE_ASCII, command_test[i].cmd, 0, NULL);
|
||||
error = GetLastError();
|
||||
|
||||
ok(ret == command_test[i].ret, "%d: expected FtpCommandA to %s\n", i, command_test[i].ret ? "succeed" : "fail");
|
||||
ok(error == command_test[i].error, "%d: expected error %u, got %u\n", i, command_test[i].error, error);
|
||||
|
||||
ret = InternetGetLastResponseInfoA(&error, NULL, NULL);
|
||||
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "%d: ret %d, lasterr %d\n", i, ret, GetLastError());
|
||||
ret = InternetGetLastResponseInfoA(NULL, NULL, &size);
|
||||
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "%d: ret %d, lasterr %d\n", i, ret, GetLastError());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue