Commit db8f5998 authored by Gijs Vermeulen's avatar Gijs Vermeulen Committed by Alexandre Julliard

ntoskrnl.exe/tests: Avoid passing uninitialized data to DeviceIoControl().

parent 217ab34f
...@@ -155,12 +155,13 @@ static void main_test(void) ...@@ -155,12 +155,13 @@ static void main_test(void)
GetTempFileNameW(temppathW, dokW, 0, pathW); GetTempFileNameW(temppathW, dokW, 0, pathW);
pRtlDosPathNameToNtPathName_U( pathW, &pathU, NULL, NULL ); pRtlDosPathNameToNtPathName_U( pathW, &pathU, NULL, NULL );
test_input = heap_alloc(sizeof(*test_input) + pathU.Length); test_input = heap_alloc( offsetof( struct test_input, path[pathU.Length / sizeof(WCHAR)]) );
test_input->running_under_wine = !strcmp(winetest_platform, "wine"); test_input->running_under_wine = !strcmp(winetest_platform, "wine");
test_input->winetest_report_success = winetest_report_success; test_input->winetest_report_success = winetest_report_success;
test_input->winetest_debug = winetest_debug; test_input->winetest_debug = winetest_debug;
lstrcpynW(test_input->path, pathU.Buffer, pathU.Length); memcpy(test_input->path, pathU.Buffer, pathU.Length + sizeof(WCHAR));
res = DeviceIoControl(device, IOCTL_WINETEST_MAIN_TEST, test_input, sizeof(*test_input) + pathU.Length, res = DeviceIoControl(device, IOCTL_WINETEST_MAIN_TEST, test_input,
offsetof( struct test_input, path[pathU.Length / sizeof(WCHAR)]),
&new_failures, sizeof(new_failures), &written, NULL); &new_failures, sizeof(new_failures), &written, NULL);
ok(res, "DeviceIoControl failed: %u\n", GetLastError()); ok(res, "DeviceIoControl failed: %u\n", GetLastError());
ok(written == sizeof(new_failures), "got size %x\n", written); ok(written == sizeof(new_failures), "got size %x\n", written);
......
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