From 9d643387fb393e9d4b5a6fa0d4693a0b735c658c Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Wed, 24 Oct 2007 15:05:17 +0200 Subject: [PATCH] initialize the m_length field. --- src/devices/wifi/ssid.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/devices/wifi/ssid.cc b/src/devices/wifi/ssid.cc index 72659fe9f..fc427d296 100644 --- a/src/devices/wifi/ssid.cc +++ b/src/devices/wifi/ssid.cc @@ -41,6 +41,8 @@ Ssid::Ssid (char const *ssid) ssid++; len++; } + NS_ASSERT (len <= 32); + m_length = len; while (len < 33) { m_ssid[len] = 0; @@ -56,6 +58,7 @@ Ssid::Ssid (char const ssid[32], uint8_t length) m_ssid[len] = ssid[len]; len++; } + m_length = length; while (len < 33) { m_ssid[len] = 0; @@ -115,6 +118,7 @@ Ssid::GetSerializedSize (void) const 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);