From 8c79e285b0f4b6b80f8ae1fe69a5288d2b4d0194 Mon Sep 17 00:00:00 2001 From: Johannes Demel Date: Wed, 20 Nov 2013 16:30:37 -0800 Subject: stall-bug: generalized message size handling --- host/lib/usrp/cores/radio_ctrl_core_3000.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/host/lib/usrp/cores/radio_ctrl_core_3000.cpp b/host/lib/usrp/cores/radio_ctrl_core_3000.cpp index 3e8de2657..27fac3471 100644 --- a/host/lib/usrp/cores/radio_ctrl_core_3000.cpp +++ b/host/lib/usrp/cores/radio_ctrl_core_3000.cpp @@ -304,8 +304,7 @@ private: while(msg.size() < min_buff_size && msg.size() != 0); if(msg.size() >= min_buff_size) { - UHD_ASSERT_THROW(min_buff_size <= sizeof(b.data)); - memcpy(b.data, &msg.front(), min_buff_size); + memcpy(b.data, &msg.front(), std::min(msg.size(), sizeof(b.data))); return true; } return false; -- cgit v1.2.3