lte: (merges !703) Fix global-buffer-overflow when nprb is equal to zero

This commit is contained in:
Gabriel Ferreira
2021-08-26 15:21:46 -03:00
committed by Tom Henderson
parent ab476ddcde
commit 00d79868c1
3 changed files with 10 additions and 5 deletions

View File

@@ -297,7 +297,7 @@ LteAmc::GetDlTbSizeFromMcs (int mcs, int nprb)
NS_LOG_FUNCTION (mcs);
NS_ASSERT_MSG (mcs < 29, "MCS=" << mcs);
NS_ASSERT_MSG (nprb < 111, "NPRB=" << nprb);
NS_ASSERT_MSG (nprb > 0 && nprb < 111, "NPRB=" << nprb);
int itbs = McsToItbsDl[mcs];
return (TransportBlockSizeTable[nprb - 1][itbs]);
@@ -309,7 +309,7 @@ LteAmc::GetUlTbSizeFromMcs (int mcs, int nprb)
NS_LOG_FUNCTION (mcs);
NS_ASSERT_MSG (mcs < 29, "MCS=" << mcs);
NS_ASSERT_MSG (nprb < 111, "NPRB=" << nprb);
NS_ASSERT_MSG (nprb > 0 && nprb < 111, "NPRB=" << nprb);
int itbs = McsToItbsUl[mcs];
return (TransportBlockSizeTable[nprb - 1][itbs]);

View File

@@ -942,8 +942,10 @@ TdMtFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::Sch
} // end for RBG free
} // end for RBGs
allocationMap.insert (std::pair <uint16_t, std::vector <uint16_t> > ((*itMax), tempMap));
if (tempMap.size() > 0)
{
allocationMap.insert (std::pair <uint16_t, std::vector <uint16_t> > ((*itMax), tempMap));
}
}
// generate the transmission opportunities by grouping the RBGs of the same RNTI and

View File

@@ -1079,7 +1079,10 @@ TdTbfqFfMacScheduler::DoSchedDlTriggerReq (const struct FfMacSchedSapProvider::S
tempMap.push_back (i);
rbgMap.at (i) = true;
}
allocationMap.insert (std::pair <uint16_t, std::vector <uint16_t> > ((*itMax).first, tempMap));
if (tempMap.size() > 0)
{
allocationMap.insert (std::pair <uint16_t, std::vector <uint16_t> > ((*itMax).first, tempMap));
}
}