diff options
author | Steve Czabaniuk <steve.czabaniuk@ni.com> | 2020-06-19 09:10:25 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-06-22 14:32:42 -0500 |
commit | 1d71d453de8991d9121f7ad07c10a2c186b6d03e (patch) | |
tree | 7065639ad13165be1551a01e1f764a01af34aaff /host | |
parent | 05137529261bf9eae2a8b72cdf67e86a8ff96927 (diff) | |
download | uhd-1d71d453de8991d9121f7ad07c10a2c186b6d03e.tar.gz uhd-1d71d453de8991d9121f7ad07c10a2c186b6d03e.tar.bz2 uhd-1d71d453de8991d9121f7ad07c10a2c186b6d03e.zip |
multi_usrp: Assert that edge_lists are non-empty before accessing
The edge_list for a given rx/tx chain should never be empty so this
explicitly performs that check, which prevents a potential bad access.
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/usrp/multi_usrp_rfnoc.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/host/lib/usrp/multi_usrp_rfnoc.cpp b/host/lib/usrp/multi_usrp_rfnoc.cpp index e535f7bc7..e35121994 100644 --- a/host/lib/usrp/multi_usrp_rfnoc.cpp +++ b/host/lib/usrp/multi_usrp_rfnoc.cpp @@ -280,6 +280,7 @@ public: for (size_t strm_port = 0; strm_port < args.channels.size(); ++strm_port) { auto rx_channel = args.channels.at(strm_port); auto rx_chain = _get_rx_chan(rx_channel); + UHD_ASSERT_THROW(!rx_chain.edge_list.empty()) // Make all of the connections in our chain for (auto edge : rx_chain.edge_list) { if (block_id_t(edge.dst_blockid).match(NODE_ID_SEP)) { @@ -349,6 +350,7 @@ public: for (size_t strm_port = 0; strm_port < args.channels.size(); ++strm_port) { auto tx_channel = args.channels.at(strm_port); auto tx_chain = _get_tx_chan(tx_channel); + UHD_ASSERT_THROW(!tx_chain.edge_list.empty()) // Make all of the connections in our chain for (auto edge : tx_chain.edge_list) { if (block_id_t(edge.src_blockid).match(NODE_ID_SEP)) { |