host: properly zero-initialize interface match structures

This can lead to some fields not properly zero-initialized, fooling
our matching code into the application having requested certain
fields to match ('0' is usually assumed to be unspecified).

Change-Id: I304d55b584e37d9dccb75b24057bb682f799beb2
This commit is contained in:
Harald Welte 2022-01-25 16:40:27 +01:00
parent 7a450041bf
commit 94cc319b8e
2 changed files with 2 additions and 0 deletions

View File

@ -549,6 +549,7 @@ int main(int argc, char **argv)
do {
struct usb_interface_match _ifm, *ifm = &_ifm;
memset(ifm, 0, sizeof(*ifm));
ifm->vendor = vendor_id;
ifm->product = product_id;
ifm->configuration = config_id;

View File

@ -303,6 +303,7 @@ int main(int argc, char **argv)
do {
if (transp->udp_fd < 0) {
struct usb_interface_match _ifm, *ifm = &_ifm;
memset(ifm, 0, sizeof(*ifm));
ifm->vendor = vendor_id;
ifm->product = product_id;
ifm->configuration = config_id;