MCPcopy Create free account
hub / github.com/SFML/SFML / checkSize

Method checkSize

src/SFML/Network/Packet.cpp:572–579  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

570
571////////////////////////////////////////////////////////////
572bool Packet::checkSize(std::size_t size)
573{
574 // Determine if size is big enough to trigger an overflow
575 const bool overflowDetected = m_readPos + size < m_readPos;
576 m_isValid = m_isValid && (m_readPos + size <= m_data.size()) && !overflowDetected;
577
578 return m_isValid;
579}
580
581
582////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected