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
diff --git a/host/src/simtrace2-cardem-pcsc.c b/host/src/simtrace2-cardem-pcsc.c
index 3ec7509..8b08f36 100644
--- a/host/src/simtrace2-cardem-pcsc.c
+++ b/host/src/simtrace2-cardem-pcsc.c
@@ -549,6 +549,7 @@
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;
diff --git a/host/src/simtrace2-tool.c b/host/src/simtrace2-tool.c
index d705796..9c9b5ed 100644
--- a/host/src/simtrace2-tool.c
+++ b/host/src/simtrace2-tool.c
@@ -303,6 +303,7 @@
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;