bug 2173: WifiInformationElement::DeserializeIfPresent attempts to read beyond the end of buffer

This commit is contained in:
Alexander Krotov
2015-09-04 01:10:29 +02:00
parent ba299a9270
commit 20f5c5e062
2 changed files with 5 additions and 1 deletions

View File

@@ -992,7 +992,7 @@ uint8_t
Buffer::Iterator::PeekU8 (void)
{
NS_ASSERT_MSG (m_current >= m_dataStart &&
m_current <= m_dataEnd,
m_current < m_dataEnd,
GetReadErrorMessage ());
if (m_current < m_zeroStart)

View File

@@ -61,6 +61,10 @@ WifiInformationElement::Deserialize (Buffer::Iterator i)
Buffer::Iterator
WifiInformationElement::DeserializeIfPresent (Buffer::Iterator i)
{
if (i.IsEnd ())
{
return i;
}
Buffer::Iterator start = i;
uint8_t elementId = i.ReadU8 ();