summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xplugin/sms_plugin/SmsPluginParamCodec.cpp4
-rwxr-xr-xplugin/sms_plugin/include/SmsPluginTypes.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/plugin/sms_plugin/SmsPluginParamCodec.cpp b/plugin/sms_plugin/SmsPluginParamCodec.cpp
index bb40be6..a3d7709 100755
--- a/plugin/sms_plugin/SmsPluginParamCodec.cpp
+++ b/plugin/sms_plugin/SmsPluginParamCodec.cpp
@@ -112,7 +112,7 @@ int SmsPluginParamCodec::encodeTime(const SMS_TIMESTAMP_S *pTimeStamp, char **pp
int SmsPluginParamCodec::encodeDCS(const SMS_DCS_S *pDCS, char **ppParam)
{
- *ppParam = new char;
+ *ppParam = new char[MAX_DCS_PARAM_LEN];
**ppParam = 0x00;
@@ -164,7 +164,7 @@ int SmsPluginParamCodec::encodeDCS(const SMS_DCS_S *pDCS, char **ppParam)
return 0;
}
- return 1;
+ return MAX_DCS_PARAM_LEN;
}
diff --git a/plugin/sms_plugin/include/SmsPluginTypes.h b/plugin/sms_plugin/include/SmsPluginTypes.h
index 3d74b7e..646947f 100755
--- a/plugin/sms_plugin/include/SmsPluginTypes.h
+++ b/plugin/sms_plugin/include/SmsPluginTypes.h
@@ -43,6 +43,7 @@ extern "C"
#define MAX_SMS_SEND_RETRY 4
#define MAX_SMSC_LEN 20
#define MAX_ADD_PARAM_LEN 12
+#define MAX_DCS_PARAM_LEN 1
#define MAX_ABS_TIME_PARAM_LEN 7
#define MAX_REL_TIME_PARAM_LEN 1
#define MAX_UD_HEADER_NUM 7