From c850e2f87adab470c0692e5781b22a0a43d3a92b Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 14 Mar 2018 23:08:51 +0100 Subject: [PATCH] Added check for issue #165 --- lib/src/common/pdu.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/src/common/pdu.cc b/lib/src/common/pdu.cc index 69c19518c..b3928f11b 100644 --- a/lib/src/common/pdu.cc +++ b/lib/src/common/pdu.cc @@ -120,8 +120,14 @@ uint8_t* sch_pdu::write_packet(srslte::log *log_h) { int init_rem_len=rem_len; sch_subh padding; - padding.set_padding(); - + padding.set_padding(); + + if (nof_subheaders <= 0) { + log_h->error("Writting PDU: nof_subheaders=%d\n", nof_subheaders); + log_h->console("Writting PDU: nof_subheaders=%d\n", nof_subheaders); + return NULL; + } + if (init_rem_len < 0) { log_h->error("init_rem_len=%d\n", init_rem_len); return NULL;