summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper
Side-by-side diff
Diffstat (limited to 'kmicromail/libmailwrapper') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp
index be825ef..ca1c7f1 100644
--- a/kmicromail/libmailwrapper/imapwrapper.cpp
+++ b/kmicromail/libmailwrapper/imapwrapper.cpp
@@ -405,5 +405,7 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
item = (mailimap_msg_att_item*)current->data;
+ if ( !item )
+ continue;
if (item->att_type!=MAILIMAP_MSG_ATT_ITEM_STATIC) {
flist = (mailimap_msg_att_dynamic*)item->att_data.att_dyn;
- if (!flist->att_list) {
+ if (!flist || !flist->att_list) {
continue;
@@ -411,4 +413,7 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
cf = flist->att_list->first;
+ if( ! cf )
for (cf = clist_begin(flist->att_list); cf!=NULL; cf = clist_next(cf)) {
cflag = (mailimap_flag_fetch*)cf->data;
+ if( ! cflag )
+ qDebug("imap:not cflag ");
if (cflag->fl_type==MAILIMAP_FLAG_FETCH_OTHER && cflag->fl_flag!=0) {
@@ -443,6 +448,12 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
}
+ if ( item->att_data.att_static == NULL )
+ continue;
if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_ENVELOPE) {
mailimap_envelope * head = item->att_data.att_static->att_data.att_env;
- m->setDate(head->env_date);
- m->setSubject(convert_String((const char*)head->env_subject));
+ if ( head == NULL )
+ continue;
+ if ( head->env_date != NULL )
+ m->setDate(head->env_date);
+ if ( head->env_subject != NULL )
+ m->setSubject(convert_String((const char*)head->env_subject));
//m->setSubject(head->env_subject);
@@ -485,3 +496,3 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
}
- if (head->env_message_id) {
+ if (head->env_message_id != NULL) {
m->setMsgid(QString(head->env_message_id));