MSG_DEBUG("pToDeleteMsgIdList->nCount [%d]", pToDeleteMsgIdList->nCount);
pToDeleteMsgIdList->msgIdList = (msg_message_id_t *)new char[sizeof(msg_message_id_t) * rowCnt];
+ memset(pToDeleteMsgIdList->msgIdList, 0x00, sizeof(msg_message_id_t) * rowCnt);
for (int i = 0; i < rowCnt; i++)
pToDeleteMsgIdList->msgIdList[i] = dbHandle->getColumnToInt(index++);
if (pMsgIdList != NULL && pToDeleteMsgIdList->nCount > 0) {
pMsgIdList->nCount = pToDeleteMsgIdList->nCount;
- pMsgIdList->msgIdList = (msg_message_id_t *)new char[sizeof(msg_message_id_t)*pToDeleteMsgIdList->nCount];
- memcpy(pMsgIdList->msgIdList, pToDeleteMsgIdList->msgIdList, sizeof(msg_message_id_t)*pToDeleteMsgIdList->nCount);
+ pMsgIdList->msgIdList = (msg_message_id_t *)new char[sizeof(msg_message_id_t) * pToDeleteMsgIdList->nCount];
+ memset(pMsgIdList->msgIdList, 0x00, sizeof(msg_message_id_t) * pToDeleteMsgIdList->nCount);
+ memcpy(pMsgIdList->msgIdList, pToDeleteMsgIdList->msgIdList, sizeof(msg_message_id_t) * pToDeleteMsgIdList->nCount);
}
/* Create thread for noti and phone log delete. */
memset(pMsgType->param.szBoundary, 0, MSG_BOUNDARY_LEN + 1);
strncpy(pMsgType->param.szBoundary, szTypeValue, MSG_BOUNDARY_LEN);
#ifdef FEATURE_JAVA_MMS
- } else if (strcasecmp(szTypeString, "Application-ID") == 0) {
+ } else if (g_ascii_strcasecmp(szTypeString, "Application-ID") == 0) {
pMsgType->param.szApplicationID = (char*) calloc(1, textLength + 1);
if (pMsgType->param.szApplicationID) {
memset(pMsgType->param.szApplicationID, 0, textLength + 1);
strncpy(pMsgType->param.szApplicationID, szTypeValue, textLength);
MSG_SEC_DEBUG("Application-ID:%s", pMsgType->param.szApplicationID);
}
- } else if (strcasecmp(szTypeString, "Reply-To-Application-ID") == 0) {
+ } else if (g_ascii_strcasecmp(szTypeString, "Reply-To-Application-ID") == 0) {
pMsgType->param.szReplyToApplicationID = (char*)calloc(1, textLength + 1);
if (pMsgType->param.szReplyToApplicationID) {
memset(pMsgType->param.szReplyToApplicationID, 0, textLength + 1);
for (int i = 0; i < pCbPage->pageHeader.totalPages; ++i) {
if (pCbPage->pageHeader.dcs.iso639Lang[0]) {
dataLen = cbData[7+(i+1)*82 + i] - 2;
- memcpy(cbMessage + offset, &cbData[7+(i*82)+ i + 2], dataLen);
- offset += dataLen;
+ if (dataLen > 0) {
+ memcpy(cbMessage + offset, &cbData[7+(i*82)+ i + 2], dataLen);
+ offset += dataLen;
+ }
} else {
dataLen = cbData[7+(i+1)*82 + i];
- memcpy(cbMessage + offset, &cbData[7+(i*82)+ i], dataLen);
- offset += dataLen;
+ if (dataLen > 0) {
+ memcpy(cbMessage + offset, &cbData[7+(i*82)+ i], dataLen);
+ offset += dataLen;
+ }
}
}
dataLen = offset;
SMS_TON_T ton;
- *ppParam = new char[MAX_ADD_PARAM_LEN];
+ char *tempParam = new char[MAX_ADD_PARAM_LEN];
+ if (tempParam == NULL)
+ return 0;
+
+ memset(tempParam, 0x00, sizeof(char)*MAX_ADD_PARAM_LEN);
/* Set Address Length */
if (temp[0] == '+') {
- (*ppParam)[offset++] = strlen(temp) - 1;
+ tempParam[offset++] = strlen(temp) - 1;
temp++;
ton = SMS_TON_INTERNATIONAL;
} else {
- (*ppParam)[offset++] = strlen(temp);
+ tempParam[offset++] = strlen(temp);
ton = pAddress->ton;
}
/* Set TON, NPI */
- (*ppParam)[offset++] = 0x80 + (ton << 4) + pAddress->npi;
+ tempParam[offset++] = 0x80 + (ton << 4) + pAddress->npi;
- MSG_DEBUG("Address length is %d.", (*ppParam)[0]);
+ MSG_DEBUG("Address length is %d.", tempParam[0]);
MSG_DEBUG("pAddress->ton : %d.", ton);
MSG_DEBUG("pAddress->npi : %d.", pAddress->npi);
- length = convertDigitToBcd(temp, strlen(temp), (unsigned char *) &((*ppParam)[offset]));
+ length = convertDigitToBcd(temp, strlen(temp), (unsigned char *) &(tempParam[offset]));
offset += length;
+ *ppParam = tempParam;
+
return offset ;
}
{
int ret = 0;
+ mx.lock();
+
bTapiResult = false;
ret = cv.timedwait(mx.pMsgMutex(), MAX_TAPI_SIM_API_TIMEOUT);
+ mx.unlock();
+
if (ret == ETIMEDOUT) {
MSG_DEBUG("WARNING: TAPI callback TIME-OUT");
return false;
if (strstr(pValue, "ms"))
bMSec = true;
- pTemp = (char *)malloc(strlen(pValue) + 1);
+ pTemp = (char *)calloc(1, strlen(pValue) + 1);
if (NULL == pTemp) {
- MSG_DEBUG("malloc for <time> attribute is failed");
+ MSG_DEBUG("calloc for <time> attribute is failed");
return 0;
}