1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-09 04:16:08 +00:00

scrrun: Check for null arguments in MoveFile.

Signed-off-by: Robert Wilhelm <robert.wilhelm@gmx.net>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Robert Wilhelm 2022-05-25 14:53:11 +02:00 committed by Alexandre Julliard
parent d8bea38f96
commit e5ae7a4026
2 changed files with 10 additions and 0 deletions

View File

@ -3758,6 +3758,9 @@ static HRESULT WINAPI filesys_MoveFile(IFileSystem3 *iface, BSTR source, BSTR de
{
TRACE("%p %s %s\n", iface, debugstr_w(source), debugstr_w(destination));
if(!source || !destination)
return E_INVALIDARG;
return MoveFileW(source, destination) ? S_OK : create_error(GetLastError());
}

View File

@ -2591,6 +2591,13 @@ static void test_MoveFile(void)
hr = IFileSystem3_DeleteFile(fs3, str, VARIANT_TRUE);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SysFreeString(str);
str = SysAllocString(L"null.txt");
hr = IFileSystem3_MoveFile(fs3, str, NULL);
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
hr = IFileSystem3_MoveFile(fs3, NULL, str);
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
SysFreeString(str);
}
static void test_DoOpenPipeStream(void)