From fa4c7074668edb3d72619225ea5698960e8dc555 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Mon, 14 May 2018 15:49:17 +0800 Subject: [PATCH] mstask: ITaskTrigger::SetTrigger() should fail on NULL input. Signed-off-by: Dmitry Timoshkov Signed-off-by: Alexandre Julliard --- dlls/mstask/task_trigger.c | 2 ++ dlls/mstask/tests/task_trigger.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/dlls/mstask/task_trigger.c b/dlls/mstask/task_trigger.c index 888fb66a4f9..6d11817e00d 100644 --- a/dlls/mstask/task_trigger.c +++ b/dlls/mstask/task_trigger.c @@ -103,6 +103,8 @@ static HRESULT WINAPI MSTASK_ITaskTrigger_SetTrigger( TRACE("(%p, %p)\n", iface, pTrigger); + if (!pTrigger) return E_INVALIDARG; + /* Verify valid structure size */ if (pTrigger->cbTriggerSize != sizeof(*pTrigger)) return E_INVALIDARG; diff --git a/dlls/mstask/tests/task_trigger.c b/dlls/mstask/tests/task_trigger.c index 3e2762079db..e22b2ae2dde 100644 --- a/dlls/mstask/tests/task_trigger.c +++ b/dlls/mstask/tests/task_trigger.c @@ -136,6 +136,9 @@ static void test_SetTrigger_GetTrigger(void) hres = ITask_CreateTrigger(test_task, &idx, &test_trigger); ok(hres == S_OK, "got %#x\n", hres); + hres = ITaskTrigger_SetTrigger(test_trigger, NULL); + ok(hres == E_INVALIDARG, "got %#x\n", hres); + /* Setup a trigger with base values for this test run */ GetLocalTime(&time); empty_trigger_state.wStartHour = time.wHour;