laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/26975 )

Change subject: host: properly zero-initialize interface match structures
......................................................................

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
---
M host/src/simtrace2-cardem-pcsc.c
M host/src/simtrace2-tool.c
2 files changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



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;

--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/26975
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I304d55b584e37d9dccb75b24057bb682f799beb2
Gerrit-Change-Number: 26975
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-MessageType: merged

Reply via email to