CRITICAL fix for packets less than 60 bytes
authorimarom <[email protected]>
Mon, 7 Mar 2016 08:00:37 +0000 (10:00 +0200)
committerimarom <[email protected]>
Mon, 7 Mar 2016 08:00:37 +0000 (10:00 +0200)
src/rpc-server/commands/trex_rpc_cmd_stream.cpp

index cf11f8c..b56d3e1 100644 (file)
@@ -81,7 +81,7 @@ TrexRpcCmdAddStream::_run(const Json::Value &params, Json::Value &result) {
     stream->m_pkt.len    = std::max(pkt_binary.size(), 60UL);
 
     /* allocate and init to zero ( with () ) */
-    stream->m_pkt.binary = new uint8_t[pkt_binary.size()]();
+    stream->m_pkt.binary = new uint8_t[stream->m_pkt.len]();
     if (!stream->m_pkt.binary) {
         generate_internal_err(result, "unable to allocate memory");
     }