[Problem] crash occured when downloading partial body
[Cause & Measure] Cause:
1. email-service requested UID, BODYSTRUCTURE, BODY to server.
2. UID was comming wrongly as 0. (not reproduced..)
3. email-service iterated its partial body download events to find proper event by comparing UID but it couldn't.
4. the array of partial body download events was out of bound
Measure: Adjusting the bound of index in iteration.
Change-Id: I8fdfe6d827b98f471b56ce6fe7481681cffc3028
Signed-off-by: intae, jeon <intae.jeon@samsung.com>
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;
}