From: Yuxuan Shui <yshui(a)codeweavers.com> HidP_GetLinkCollectionNodes can returns a larger nodes_count than the capacity of nodes. --- dlls/hid/tests/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/hid/tests/device.c b/dlls/hid/tests/device.c index 2c097a16367..8b5ff7a0fe7 100644 --- a/dlls/hid/tests/device.c +++ b/dlls/hid/tests/device.c @@ -61,7 +61,7 @@ static void test_device_info(HANDLE device) status = HidP_GetLinkCollectionNodes(nodes, &nodes_count, ppd); ok(status == HIDP_STATUS_SUCCESS, "HidP_GetLinkCollectionNodes failed:%lx\n", status); - for (i = 0; i < nodes_count; ++i) + for (i = 0; i < min(nodes_count, ARRAY_SIZE(nodes)); ++i) { trace(" [%d] LinkUsage: %x LinkUsagePage: %x Parent: %x " "NumberOfChildren: %x NextSibling: %x FirstChild: %x " -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8424