Elizabeth Figura (@zfigura) commented about dlls/setupapi/devinst.c:
+ have_name = SetupFindFirstLineW(hinf, Version, Class, &inf_ctx);
- if (dret >= MAX_PATH -1) FIXME("buffer might be too small\n"); + class_name_len = 0; + if (have_name) + { + if (!SetupGetStringFieldW(&inf_ctx, 1, buffer, ARRAY_SIZE(buffer), NULL)) + { + ERR("failed to get [Version].Class as a string from '%s'\n", debugstr_w(inf)); + goto out; + } + + class_name_len = lstrlenW(buffer); + } + + if (class_name_len >= MAX_PATH - 1) FIXME("buffer might be too small\n"); That's impossible; "buffer" is of length MAX_PATH. If we're going to overrun the buffer then SetupGetStringFieldW() would have failed anyway.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/5519#note_68515