msg_s->mail->full_address_from = (char *)calloc(1, sizeof(char) * (len));/* "++"+<+ address +> + NULL */
char *strfrom = msg_s->mail->full_address_from;
- if (account->incoming_server_user_name)
- snprintf(strfrom, len, "%s%s%s%s%s%s", "\"", account->incoming_server_user_name, "\"", "<", account->user_email_address, ">");
- else
- snprintf(strfrom, len, "%s%s%s", "<", account->user_email_address, ">");
+ if (NULL != strfrom) {
+ if (account->incoming_server_user_name)
+ snprintf(strfrom, len, "%s%s%s%s%s%s", "\"", account->incoming_server_user_name, "\"", "<", account->user_email_address, ">");
+ else
+ snprintf(strfrom, len, "%s%s%s", "<", account->user_email_address, ">");
+ }
/* mbox */
email_mailbox_t *mbox = msg_s->mbox;
}
free(prefix_path);
- file = fopen(file_path, "w");
+ file = fdopen(mkstemp(file_path), "w");
if (NULL == file) {
/* LCOV_EXCL_START */
SECURE_SLOGE("fopen() Fail(%d)", EMAILS_ERROR_OPERATION_FAILED);
fputs(body, file);
fclose(file);
+ unlink(file_path);
msg_s->mail->file_path_plain = file_path;