diff options
author | Youngjae Shin <yj99.shin@samsung.com> | 2018-05-18 10:38:32 +0900 |
---|---|---|
committer | Youngjae Shin <yj99.shin@samsung.com> | 2018-05-18 10:38:32 +0900 |
commit | ea049e2bd6c62f5d0ffded2f2147931250535d77 (patch) | |
tree | 9f39eb752e2e7d4012250e09d8613dfd858a3891 | |
parent | 04b258e30be9e320e21bef0cd5da57a44aeddc3f (diff) | |
download | email-service-ea049e2bd6c62f5d0ffded2f2147931250535d77.tar.gz email-service-ea049e2bd6c62f5d0ffded2f2147931250535d77.tar.bz2 email-service-ea049e2bd6c62f5d0ffded2f2147931250535d77.zip |
prevent dereferencing of NULLsubmit/tizen/20180518.014325accepted/tizen/unified/20180518.060651
Change-Id: I4f9e34fafd95b4175399aa4198ebf91ac2e97a72
-rwxr-xr-x | email-core/email-core-mailbox-sync.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/email-core/email-core-mailbox-sync.c b/email-core/email-core-mailbox-sync.c index 2aa22d6..9aa69f6 100755 --- a/email-core/email-core-mailbox-sync.c +++ b/email-core/email-core-mailbox-sync.c @@ -3531,8 +3531,10 @@ INTERNAL_FUNC int emcore_sync_mail_from_client_to_server(char *multi_user_name, if (read_size != data_size) { /* read fail. */ - EM_SAFE_FREE(data); EM_DEBUG_EXCEPTION("Read from file failed"); + INIT(&str_data, mail_string, NULL, read_size); + } else { + INIT(&str_data, mail_string, data, read_size); } sent_size += read_size; @@ -3571,12 +3573,13 @@ INTERNAL_FUNC int emcore_sync_mail_from_client_to_server(char *multi_user_name, if (read_size != data_size) { /* read fail. */ - EM_SAFE_FREE(data); EM_DEBUG_EXCEPTION("Read from file failed"); + INIT(&str_data, mail_string, NULL, read_size); + } else { + INIT(&str_data, mail_string, data, read_size); } sent_size += read_size; - INIT(&str_data, mail_string, data, read_size); if (!mail_append_message(stream, long_enc_path, &str_data)) { EM_DEBUG_EXCEPTION("mail_append failed -"); err = EMAIL_ERROR_IMAP4_APPEND_FAILURE; |