return;
}
- fchmod(fd, 0666);
+ fchmod(fd, 0644);
MSG_DEBUG("** Create SHM FILE **");
if (ftruncate(fd, sizeof(pthread_mutex_t)) != 0) {
MSG_FATAL("ftruncate errno [%d]", errno);
free(encoded_data);
- if (chmod(fileName, 0666) == -1) {
+ if (chmod(fileName, 0644) == -1) {
MSG_FATAL("chmod: %s", g_strerror(errno));
return MSG_ERR_UNKNOWN;
}
VTree* vMsg = NULL;
VObject* pObject = NULL;
bool isMMS = false;
-
- msg_id_list_s *msgIdList = NULL;
- msgIdList = (msg_id_list_s *)calloc(1, sizeof(msg_id_list_s));
-
int dataSize = 0;
char fileName[MSG_FILENAME_LEN_MAX+1];
*result_id_list = NULL;
+ msg_id_list_s *msgIdList = NULL;
+ msgIdList = (msg_id_list_s *)calloc(1, sizeof(msg_id_list_s));
+ if (!msgIdList) {
+ MSG_DEBUG("calloc failed");
+ err = MSG_ERR_UNKNOWN;
+ goto __RETURN;
+ }
#ifdef MSG_FOR_DEBUG
char sample[10000] = "BEGIN:VMSG\r\nX-MESSAGE-TYPE:SMS\r\nX-IRMC-BOX:INBOX\r\nX-SS-DT:20100709T155811Z\r\nBEGIN:VBODY\r\nX-BODY-SUBJECT:hekseh\r\nX-BODY-CONTENTS;ENCODING=BASE64:aGVsbG93b3JsZA==\r\nEND:VBODY\r\nBEGIN:VCARD\r\nVERSION:2.1\r\nTEL:01736510664\r\nEND:VCARD\r\nEND:VMSG\r\n";
vMsg = vmsg_decode(sample);
if (msgIdList->nCount == 0) {
msgIdList->msgIdList = (msg_message_id_t*)calloc(1, sizeof(msg_message_id_t));
+ if (msgIdList->msgIdList == NULL) {
+ MSG_DEBUG("calloc failed");
+ err = MSG_ERR_UNKNOWN;
+ goto __RETURN;
+ }
} else {
msg_message_id_t * msg_id_list;
msg_id_list = (msg_message_id_t*)realloc(msgIdList->msgIdList, sizeof(msg_message_id_t)*(msgIdList->nCount+1));
goto __CATCH;
}
- memcpy(pUTF8Buff, pSrc, length);
+ memcpy(pUTF8Buff, pSrc, length+1);
}
/* convert hex string */
return ELEMENT_REF;
else if (!strcmp(pString, "animate"))
return ELEMENT_ANIMATE;
- else if (!strcmp(pString, "root-layout"))
- return ELEMENT_HEAD;
else if (!strcmp(pString, "transition"))
return ELEMENT_TRANSITION;
else if (!strcmp(pString, "meta"))
}
gMedia = (MMS_MEDIA_S *)calloc(1, sizeof(MMS_MEDIA_S));
+ if (!gMedia) {
+ MSG_DEBUG("calloc for gMedia is failed");
+ return;
+ }
gMedia->mediatype = MMS_SMIL_MEDIA_TEXT;
gCmd[ELEMENT_TEXT] = true;
break;
}
gMedia = (MMS_MEDIA_S *)calloc(1, sizeof(MMS_MEDIA_S));
+ if (!gMedia) {
+ MSG_DEBUG("calloc for gMedia is failed");
+ return;
+ }
gMedia->mediatype = MMS_SMIL_MEDIA_IMG;
gCmd[ELEMENT_IMG] = true;
break;
}
gMedia = (MMS_MEDIA_S *)calloc(1, sizeof(MMS_MEDIA_S));
+ if (!gMedia) {
+ MSG_DEBUG("calloc for gMedia is failed");
+ return;
+ }
gMedia->mediatype = MMS_SMIL_MEDIA_AUDIO;
gCmd[ELEMENT_AUDIO] = true;
break;
}
gMedia = (MMS_MEDIA_S *)calloc(1, sizeof(MMS_MEDIA_S));
+ if (!gMedia) {
+ MSG_DEBUG("calloc for gMedia is failed");
+ return;
+ }
gMedia->mediatype = MMS_SMIL_MEDIA_VIDEO;
gCmd[ELEMENT_VIDEO] = true;
break;
}
gMedia = (MMS_MEDIA_S *)calloc(1, sizeof(MMS_MEDIA_S));
+ if (!gMedia) {
+ MSG_DEBUG("calloc for gMedia is failed");
+ return;
+ }
gMedia->mediatype = MMS_SMIL_MEDIA_IMG_OR_VIDEO;
gCmd[ELEMENT_REF] = true;
break;
}
gMedia = (MMS_MEDIA_S *)calloc(1, sizeof(MMS_MEDIA_S));
+ if (!gMedia) {
+ MSG_DEBUG("calloc for gMedia is failed");
+ return;
+ }
gMedia->mediatype = MMS_SMIL_MEDIA_ANIMATE;
gCmd[ELEMENT_ANIMATE] = true;
break;
if (temp) {
long len = (long)temp - (long)src;
*prefix = (char *)calloc(len+1, sizeof(char));
- snprintf(*prefix, len+1, "%s", src);
+ if (*prefix) {
+ snprintf(*prefix, len+1, "%s", src);
+ } else {
+ *prefix = NULL;
+ }
} else {
*prefix = NULL;
}
decoded_str = g_base64_decode(src, &size);
dest = (char *)calloc((src-val)+size+1, sizeof(char));
+ if (NULL == dest) {
+ return NULL;
+ }
snprintf(dest, (src-val)+1, "%s", val);
snprintf(dest+(src-val), size+1, "%s", decoded_str);
g_free(decoded_str);