Revert "crash occured when downloading partial body" 97/92197/2
authorJongkyu Koo <jk.koo@samsung.com>
Thu, 13 Oct 2016 19:25:48 +0000 (12:25 -0700)
committerJongkyu Koo <jk.koo@samsung.com>
Thu, 13 Oct 2016 19:26:57 +0000 (12:26 -0700)
This reverts commit a1906a2158fac3bb6cff35a679b9d403787ebf50.

Change-Id: I34e3bef3e34d259891ab68b3052682354a32579c

email-core/email-core-mailbox-sync.c

index 116c083..859b2b0 100755 (executable)
@@ -3961,10 +3961,10 @@ static int emcore_gmime_download_imap_partial_mail_body(MAILSTREAM *stream, int
                if (!(imap_response[i].bodystructure) || imap_response[i].bodystructure_len <= 0) continue;
 
                /* Search the account id of pbd_event */
-               for (temp_count = 0; temp_count < item_count && pbd_event[temp_count].server_mail_id != imap_response[i].uid_no; temp_count++)
+               for (temp_count = 0; temp_count <= item_count && pbd_event[temp_count].server_mail_id != imap_response[i].uid_no; temp_count++)
                        continue;
 
-               if (temp_count > item_count) {
+               if (temp_count > item_count) {
                        EM_DEBUG_EXCEPTION("Can't find proper server_mail_id");
                        goto FINISH_OFF;
                }