initialize the m_length field.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 24 Oct 2007 15:05:17 +0200
changeset 2021 99a028507709
parent 2020 38a5381d93cd
child 2022 33579d27ce2a
initialize the m_length field.
src/devices/wifi/ssid.cc
--- a/src/devices/wifi/ssid.cc	Tue Oct 23 14:00:53 2007 +0200
+++ b/src/devices/wifi/ssid.cc	Wed Oct 24 15:05:17 2007 +0200
@@ -41,6 +41,8 @@
       ssid++;
       len++;
     }
+  NS_ASSERT (len <= 32);
+  m_length = len;
   while (len < 33) 
     {
       m_ssid[len] = 0;
@@ -56,6 +58,7 @@
       m_ssid[len] = ssid[len];
       len++;
     }
+  m_length = length;
   while (len < 33) 
     {
       m_ssid[len] = 0;
@@ -115,6 +118,7 @@
 Buffer::Iterator 
 Ssid::Serialize (Buffer::Iterator i) const
 {
+  NS_ASSERT (m_length <= 32);
   i.WriteU8 (ELEMENT_ID);
   i.WriteU8 (m_length);
   i.Write (m_ssid, m_length);