From b2678c62d212c9e4674cb2dce5010b6da697131e Mon Sep 17 00:00:00 2001 From: Ashish Chaudhari Date: Tue, 12 Jul 2016 11:24:25 -0700 Subject: x300: Minor: Assert if FPGA image identifier is not long enough --- host/lib/usrp/x300/x300_impl.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'host') diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index 2fb7df954..b59b920ab 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -1359,6 +1359,8 @@ x300_impl::both_xports_t x300_impl::make_transport( fs_path mboard_path = fs_path("/mboards/"+boost::lexical_cast(mb_index) / "link_max_rate"); + UHD_ASSERT_THROW(mb.loaded_fpga_image.size() >= 2); + if (mb.loaded_fpga_image.substr(0,2) == "HG") { size_t max_link_rate = 0; if (config.iface_index == X300_IFACE_ETH0) { -- cgit v1.2.3