mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
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:
@@ -549,6 +549,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
struct usb_interface_match _ifm, *ifm = &_ifm;
|
struct usb_interface_match _ifm, *ifm = &_ifm;
|
||||||
|
memset(ifm, 0, sizeof(*ifm));
|
||||||
ifm->vendor = vendor_id;
|
ifm->vendor = vendor_id;
|
||||||
ifm->product = product_id;
|
ifm->product = product_id;
|
||||||
ifm->configuration = config_id;
|
ifm->configuration = config_id;
|
||||||
|
|||||||
@@ -303,6 +303,7 @@ int main(int argc, char **argv)
|
|||||||
do {
|
do {
|
||||||
if (transp->udp_fd < 0) {
|
if (transp->udp_fd < 0) {
|
||||||
struct usb_interface_match _ifm, *ifm = &_ifm;
|
struct usb_interface_match _ifm, *ifm = &_ifm;
|
||||||
|
memset(ifm, 0, sizeof(*ifm));
|
||||||
ifm->vendor = vendor_id;
|
ifm->vendor = vendor_id;
|
||||||
ifm->product = product_id;
|
ifm->product = product_id;
|
||||||
ifm->configuration = config_id;
|
ifm->configuration = config_id;
|
||||||
|
|||||||
Reference in New Issue
Block a user