[Coverity] Untrusted loop bound (TAINTED_SCALAR)

This commit is contained in:
Peter D. Barnes, Jr.
2013-05-20 15:50:00 -07:00
parent 9ef6072262
commit 84126f97be
3 changed files with 3 additions and 3 deletions

View File

@@ -86,7 +86,7 @@ InetTopologyReader::Read (void)
lineBuffer >> totlink;
NS_LOG_INFO ("Inet topology should have " << totnode << " nodes and " << totlink << " links");
for (int i = 0; i < totnode; i++)
for (int i = 0; i < totnode && !topgen.eof (); i++)
{
getline (topgen,line);
}

View File

@@ -64,7 +64,7 @@ operator>> (std::istream &is, UanPdp &pdp)
std::complex<double> amp;
pdp.m_taps = std::vector<Tap> (ntaps);
for (uint32_t i = 0; i < ntaps; i++)
for (uint32_t i = 0; i < ntaps && !is.eof (); i++)
{
is >> amp >> c1;
if (c1 != '|')

View File

@@ -288,7 +288,7 @@ operator >> (std::istream &is, UanModesList &ml)
ml.m_modes.clear ();
ml.m_modes.resize (numModes);
for (int i = 0; i < numModes; i++)
for (int i = 0; i < numModes && !is.eof (); i++)
{
is >> ml.m_modes[i] >> c;
if (c != '|')