diff options
author | Martin Anderseck <martin.anderseck@ni.com> | 2021-08-18 08:23:53 +0200 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-08-20 15:02:38 -0500 |
commit | 3a36577a30ead6d616ffb8cc23fe9b57b40a2647 (patch) | |
tree | d7b24991184c3a45f0094343ec43d26f2a58ff18 /host | |
parent | 7788526fbe9fe286be141dba4f387c4bf6a921d4 (diff) | |
download | uhd-3a36577a30ead6d616ffb8cc23fe9b57b40a2647.tar.gz uhd-3a36577a30ead6d616ffb8cc23fe9b57b40a2647.tar.bz2 uhd-3a36577a30ead6d616ffb8cc23fe9b57b40a2647.zip |
X300: Initialize struct variable before using it
In x300_eth_mgr.cpp the variable init is created but not initialized.
Only some of the variables within the struct are then set before init
is assigned to a different variable. Initialize the variable to
prevent unexpected values.
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/usrp/x300/x300_eth_mgr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/host/lib/usrp/x300/x300_eth_mgr.cpp b/host/lib/usrp/x300/x300_eth_mgr.cpp index dcc8195ae..c5ddf54f3 100644 --- a/host/lib/usrp/x300/x300_eth_mgr.cpp +++ b/host/lib/usrp/x300/x300_eth_mgr.cpp @@ -196,7 +196,7 @@ eth_manager::eth_manager( // Initially store only the first address provided to setup communication // Once we read the EEPROM, we use it to map IP to its interface // In discover_eth(), we'll check and enable the other IP address, if given - x300_eth_conn_t init; + x300_eth_conn_t init = x300_eth_conn_t(); init.addr = args.get_first_addr(); auto device_id = allocate_device_id(); _local_device_ids.push_back(device_id); |