From c47c4b8b03fdd974c9eac1e504bbc0fe423d496b Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Wed, 21 Jun 2017 11:22:10 +0200 Subject: [PATCH] fixed overflow in tests --- lib/src/phy/phch/test/pdsch_test.c | 2 +- lib/src/phy/phch/test/pusch_test.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/phy/phch/test/pdsch_test.c b/lib/src/phy/phch/test/pdsch_test.c index 8926e3bd3..d4e5163d3 100644 --- a/lib/src/phy/phch/test/pdsch_test.c +++ b/lib/src/phy/phch/test/pdsch_test.c @@ -171,7 +171,7 @@ int main(int argc, char **argv) { } } - data = srslte_vec_malloc(sizeof(uint8_t) * grant.mcs.tbs/8); + data = srslte_vec_malloc(sizeof(uint8_t) * (grant.mcs.tbs/8)+24); if (!data) { perror("srslte_vec_malloc"); goto quit; diff --git a/lib/src/phy/phch/test/pusch_test.c b/lib/src/phy/phch/test/pusch_test.c index 7cf80a7d1..0cb2847b7 100644 --- a/lib/src/phy/phch/test/pusch_test.c +++ b/lib/src/phy/phch/test/pusch_test.c @@ -188,7 +188,7 @@ int main(int argc, char **argv) { exit(-1); } - data = srslte_vec_malloc(sizeof(uint8_t) * cfg.grant.mcs.tbs); + data = srslte_vec_malloc(sizeof(uint8_t) * (cfg.grant.mcs.tbs+24)); if (!data) { perror("malloc"); exit(-1);