[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 02/07: digital: Fix alloc bug in HDLC defra
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 02/07: digital: Fix alloc bug in HDLC deframer and make Coverity happy. |
Date: |
Fri, 16 May 2014 23:49:30 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit c655a681f6ed6f3153fe35257819597625adf0b9
Author: Nick Foster <address@hidden>
Date: Mon May 12 09:58:53 2014 -0700
digital: Fix alloc bug in HDLC deframer and make Coverity happy.
---
gr-digital/lib/hdlc_deframer_bp_impl.cc | 6 ++++--
1 file 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 12d7ec6..0723ad4 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 {
- [Commit-gnuradio] [gnuradio] branch master updated (5974a3e -> cb0bc7f), git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 03/07: pmt: adding pmt.uniform_vector_itemsize(pmt_t vector), returns the size per item in bytes within a uniform vector for any kind of uniform vector, git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 07/07: Merge remote-tracking branch 'osh/pdu_uvector_itemsize', git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 06/07: Merge remote-tracking branch 'bistromath/hdlc_fix', git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 05/07: Merge remote-tracking branch 'osh/pdu_filter_inversion', git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 01/07: blocks: pdu_filter, add option for filter match inversion, git, 2014/05/16
- [Commit-gnuradio] [gnuradio] 02/07: digital: Fix alloc bug in HDLC deframer and make Coverity happy.,
git <=
- [Commit-gnuradio] [gnuradio] 04/07: Merge branch 'maint', git, 2014/05/16