EM_DEBUG_DB_EXEC(SQLITE_OK != rc, {error = EMAIL_ERROR_DB_FAILURE; sqlite3_free_table(result); goto FINISH_OFF; },
("SQL(%s) sqlite3_get_table fail:%d -%s", sql, rc, sqlite3_errmsg(local_db_handle)));
+
count = atoi(result[1]);
sqlite3_free_table(result);
+
EM_DEBUG_LOG_DEV("count = %d", rc);
+
+
if (count <= 0) {
EM_DEBUG_LOG("no account found...");
error = EMAIL_ERROR_ACCOUNT_NOT_FOUND;
ret = true;
goto FINISH_OFF;
}
+
+ if (count > EMAIL_ACCOUNT_MAX) {
+ EM_DEBUG_EXCEPTION("OVERFLOWED THE MAX ACCOUNT");
+ error = EMAIL_ERROR_ACCOUNT_MAX_COUNT;
+ ret = true;
+ goto FINISH_OFF;
+ }
+
SNPRINTF(sql_query_string, sizeof(sql_query_string), "SELECT ");
sql_len = EM_SAFE_STRLEN(sql_query_string);
goto FINISH_OFF;
}
+ if (*output_attachment_count > EMAIL_ATTACHMENT_MAX_COUNT || *output_attachment_count < 0) {
+ EM_DEBUG_EXCEPTION("loop count error");
+ error = EMAIL_ERROR_LOOP_COUNT;
+ goto FINISH_OFF;
+
+ }
+
+
p_data_tbl = (emstorage_attachment_tbl_t*)em_malloc(sizeof(emstorage_attachment_tbl_t) * (*output_attachment_count));
if (!p_data_tbl) {
goto FINISH_OFF;
}
+ if (*count > MAX_LOOP_COUNT) {
+ EM_DEBUG_EXCEPTION("loop count error");
+ error = EMAIL_ERROR_LOOP_COUNT;
+ ret = true;
+ goto FINISH_OFF;
+ }
+
EM_DEBUG_LOG("Account count [%d]", *count);
memset(sql_query_string, 0x00, sizeof(sql_query_string));
ret = true;
goto FINISH_OFF;
}
+
+ if (*count > MAX_LOOP_COUNT) {
+ EM_DEBUG_EXCEPTION("loop count error");
+ error = EMAIL_ERROR_LOOP_COUNT;
+ ret = true;
+ goto FINISH_OFF;
+ }
+
+
EM_DEBUG_LOG("Activity Count = %d", *count);
memset(sql_query_string, 0x00, sizeof(sql_query_string));
goto FINISH_OFF;
}
+ if (count > MAX_LOOP_COUNT || count < 0) {
+ EM_DEBUG_EXCEPTION("loop count error");
+ err = EMAIL_ERROR_LOOP_COUNT;
+ goto FINISH_OFF;
+ }
+
+
SNPRINTF_OFFSET(sql_query_string, cur_query, QUERY_SIZE,
"SELECT %s FROM mail_task_tbl %s %s", field_list, input_conditional_clause, input_ordering_clause);
EM_DEBUG_LOG_SEC("emstorage_query_mail_list : query[%s].", sql_query_string);