Added check for issue #165

This commit is contained in:
Ismael Gomez 2018-03-14 23:08:51 +01:00
parent bd258372ea
commit c850e2f87a
1 changed files with 8 additions and 2 deletions

View File

@ -122,6 +122,12 @@ uint8_t* sch_pdu::write_packet(srslte::log *log_h)
sch_subh 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;