# HG changeset patch # User Tom Henderson # Date 1496155133 25200 # Tue May 30 07:38:53 2017 -0700 # Node ID 643f69541b73d457229c4df44432cf54ecedb184 # Parent 0117c320c44bad9c124fc2ea02c6eb45e1268a35 fix bug in WifiInformationElement::Deserialize diff -r 0117c320c44b -r 643f69541b73 src/wifi/model/wifi-information-element-vector.cc --- a/src/wifi/model/wifi-information-element-vector.cc Tue May 30 07:37:54 2017 -0700 +++ b/src/wifi/model/wifi-information-element-vector.cc Tue May 30 07:38:53 2017 -0700 @@ -80,13 +80,15 @@ WifiInformationElementVector::Deserialize (Buffer::Iterator start, Buffer::Iterator end) { uint32_t size = start.GetDistanceFrom (end); - while (size > 0) + uint32_t remaining = size; + while (remaining > 0) { uint32_t deserialized = DeserializeSingleIe (start); start.Next (deserialized); - NS_ASSERT (deserialized <= size); - size -= deserialized; + NS_ASSERT (deserialized <= remaining); + remaining -= deserialized; } + NS_ASSERT_MSG (remaining == 0, "Error in deserialization"); return size; }