Commit 5d2f8023 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

ole32: Validate the parameters to DataCache_Cache.

parent f94b8202
......@@ -1971,6 +1971,10 @@ static HRESULT WINAPI DataCache_Cache(
HRESULT hr;
TRACE("(%p, 0x%x, %p)\n", pformatetc, advf, pdwConnection);
if (!pformatetc || !pdwConnection)
return E_INVALIDARG;
TRACE("pformatetc = %s\n", debugstr_formatetc(pformatetc));
*pdwConnection = 0;
......
......@@ -1128,6 +1128,12 @@ static void test_data_cache(void)
hr = IOleCache_Uncache(pOleCache, 0xdeadbeef);
ok(hr == OLE_E_NOCONNECTION, "IOleCache_Uncache with invalid value should return OLE_E_NOCONNECTION instead of 0x%x\n", hr);
hr = IOleCache_Cache(pOleCache, NULL, 0, &dwConnection);
ok(hr == E_INVALIDARG, "IOleCache_Cache with NULL fmtetc should have returned E_INVALIDARG instead of 0x%08x\n", hr);
hr = IOleCache_Cache(pOleCache, NULL, 0, NULL);
ok(hr == E_INVALIDARG, "IOleCache_Cache with NULL pdwConnection should have returned E_INVALIDARG instead of 0x%08x\n", hr);
for (fmtetc.cfFormat = CF_TEXT; fmtetc.cfFormat < CF_MAX; fmtetc.cfFormat++)
{
int i;
......
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