From 3a36577a30ead6d616ffb8cc23fe9b57b40a2647 Mon Sep 17 00:00:00 2001 From: Martin Anderseck Date: Wed, 18 Aug 2021 08:23:53 +0200 Subject: 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. --- host/lib/usrp/x300/x300_eth_mgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'host/lib') 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); -- cgit v1.2.3