bug 2173: WifiInformationElement::DeserializeIfPresent attempts to read beyond the end of buffer
--- a/src/network/model/buffer.h Thu Sep 03 23:57:43 2015 +0200
+++ b/src/network/model/buffer.h Fri Sep 04 01:10:29 2015 +0200
@@ -992,7 +992,7 @@
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)
--- a/src/wifi/model/wifi-information-element.cc Thu Sep 03 23:57:43 2015 +0200
+++ b/src/wifi/model/wifi-information-element.cc Fri Sep 04 01:10:29 2015 +0200
@@ -61,6 +61,10 @@
Buffer::Iterator
WifiInformationElement::DeserializeIfPresent (Buffer::Iterator i)
{
+ if (i.IsEnd ())
+ {
+ return i;
+ }
Buffer::Iterator start = i;
uint8_t elementId = i.ReadU8 ();