summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2014-05-16 16:10:08 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2014-05-16 16:10:08 -0700
commita9b241b7505be3eaefd36205346e7238b6f2163a (patch)
tree95f17fabc650b76ed159e4695c38ffa7163c98b8
parent1c101701e34cdce5bc608598792b7b0ca0545f65 (diff)
parentc655a681f6ed6f3153fe35257819597625adf0b9 (diff)
Merge remote-tracking branch 'bistromath/hdlc_fix'
-rw-r--r--gr-digital/lib/hdlc_deframer_bp_impl.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gr-digital/lib/hdlc_deframer_bp_impl.cc b/gr-digital/lib/hdlc_deframer_bp_impl.cc
index 12d7ec66bc..0723ad473e 100644
--- a/gr-digital/lib/hdlc_deframer_bp_impl.cc
+++ b/gr-digital/lib/hdlc_deframer_bp_impl.cc
@@ -64,6 +64,7 @@ namespace gr {
*/
hdlc_deframer_bp_impl::~hdlc_deframer_bp_impl()
{
+ delete[] d_pktbuf;
}
unsigned int
@@ -94,12 +95,13 @@ namespace gr {
if(bit) { //six ones is a frame delimiter
if(d_bytectr >= d_length_min) {
//check CRC, publish frame
+ int len = d_bytectr - 2; //make Coverity happy
unsigned short crc = d_pktbuf[d_bytectr-1] << 8
| d_pktbuf[d_bytectr-2];
- unsigned short calc_crc = crc_ccitt(d_pktbuf, d_bytectr-2);
+ unsigned short calc_crc = crc_ccitt(d_pktbuf, len);
if (crc==calc_crc) {
pmt::pmt_t pdu(pmt::cons(pmt::PMT_NIL,
- pmt::make_blob(&d_pktbuf[0], d_bytectr-2)));
+ pmt::make_blob(d_pktbuf, len)));
message_port_pub(pmt::mp("out"), pdu);
}
else {