Commit e5ae7a40 authored by Robert Wilhelm's avatar Robert Wilhelm Committed by Alexandre Julliard

scrrun: Check for null arguments in MoveFile.

parent d8bea38f
...@@ -3758,6 +3758,9 @@ static HRESULT WINAPI filesys_MoveFile(IFileSystem3 *iface, BSTR source, BSTR de ...@@ -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)); 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()); return MoveFileW(source, destination) ? S_OK : create_error(GetLastError());
} }
......
...@@ -2591,6 +2591,13 @@ static void test_MoveFile(void) ...@@ -2591,6 +2591,13 @@ static void test_MoveFile(void)
hr = IFileSystem3_DeleteFile(fs3, str, VARIANT_TRUE); hr = IFileSystem3_DeleteFile(fs3, str, VARIANT_TRUE);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
SysFreeString(str); 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) static void test_DoOpenPipeStream(void)
......
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