--- a/src/wimax/model/snr-to-block-error-rate-manager.cc Wed May 15 09:55:22 2013 -0400
+++ b/src/wimax/model/snr-to-block-error-rate-manager.cc Wed May 15 09:56:21 2013 -0400
@@ -24,6 +24,7 @@
#include "ns3/snr-to-block-error-rate-record.h"
#include "default-traces.h"
#include "ns3/log.h"
+#include "ns3/assert.h"
#include <fstream>
NS_LOG_COMPONENT_DEFINE ("SNRToBlockErrorRateManager");
@@ -273,6 +274,8 @@
void
SNRToBlockErrorRateManager::SetTraceFilePath (char *traceFilePath)
{
+ NS_ASSERT_MSG (std::strlen (traceFilePath) < TRACE_FILE_PATH_SIZE,
+ "char * traceFilePath too long");
std::strcpy (m_traceFilePath, traceFilePath);
}
--- a/src/wimax/model/snr-to-block-error-rate-manager.h Wed May 15 09:55:22 2013 -0400
+++ b/src/wimax/model/snr-to-block-error-rate-manager.h Wed May 15 09:56:21 2013 -0400
@@ -94,7 +94,8 @@
void ClearRecords (void);
double m_speed; // in m/s
uint8_t m_activateLoss;
- char m_traceFilePath[1024];
+ static const unsigned int TRACE_FILE_PATH_SIZE = 1024;
+ char m_traceFilePath[TRACE_FILE_PATH_SIZE];
std::vector<SNRToBlockErrorRateRecord *> * m_recordModulation[7];