calloc libusb_interface instead of pointer (#3793)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled

interface->num_altsetting is oob
This commit is contained in:
Stephen Miller 2025-11-12 09:26:26 -06:00 committed by GitHub
parent 25344a3b89
commit 93c340c6e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -312,7 +312,7 @@ public:
const auto endpoint_descs = FillEndpointDescriptorPair();
const auto interface_desc = FillInterfaceDescriptor(endpoint_descs);
const auto interface = static_cast<libusb_interface*>(calloc(1, sizeof(libusb_interface*)));
const auto interface = static_cast<libusb_interface*>(calloc(1, sizeof(libusb_interface)));
interface->altsetting = interface_desc;
interface->num_altsetting = 1;