summaryrefslogtreecommitdiffabout
path: root/kmicromail/libetpan
Side-by-side diff
Diffstat (limited to 'kmicromail/libetpan') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/libetpan/generic/pop3driver.c7
-rw-r--r--kmicromail/libetpan/pop3/mailpop3.c5
-rw-r--r--kmicromail/libetpan/tools/mailstream_helper.c9
3 files changed, 17 insertions, 4 deletions
diff --git a/kmicromail/libetpan/generic/pop3driver.c b/kmicromail/libetpan/generic/pop3driver.c
index 375879e..475dfcc 100644
--- a/kmicromail/libetpan/generic/pop3driver.c
+++ b/kmicromail/libetpan/generic/pop3driver.c
@@ -272,6 +272,9 @@ static int pop3driver_login(mailsession * session,
}
-
+ // LR 2 lines
+ int ret = pop3driver_pop3_error_to_mail_error(r);
+ if ( ret == MAIL_NO_ERROR )
mailpop3_list(get_pop3_session(session), &msg_tab);
- return pop3driver_pop3_error_to_mail_error(r);
+ // LR
+ return ret;
}
diff --git a/kmicromail/libetpan/pop3/mailpop3.c b/kmicromail/libetpan/pop3/mailpop3.c
index 28fafe9..691b07a 100644
--- a/kmicromail/libetpan/pop3/mailpop3.c
+++ b/kmicromail/libetpan/pop3/mailpop3.c
@@ -510,4 +510,7 @@ int mailpop3_pass(mailpop3 * f, const char * password)
- if (r != RESPONSE_OK)
+ if (r != RESPONSE_OK) {
+ // LR
+ fprintf(stderr,"POP3 login error. Response from server:\n%s\n",response );
return MAILPOP3_ERROR_BAD_PASSWORD;
+ }
diff --git a/kmicromail/libetpan/tools/mailstream_helper.c b/kmicromail/libetpan/tools/mailstream_helper.c
index 146f955..92f4ffe 100644
--- a/kmicromail/libetpan/tools/mailstream_helper.c
+++ b/kmicromail/libetpan/tools/mailstream_helper.c
@@ -100,3 +100,9 @@ char * mailstream_read_line_append(mailstream * stream, MMAPString * line)
- if (r == 0)
+ if (r == 0) {
+ // LR
+ // this avoids a memory access violation later when trying
+ // to remove_trailing_eol from a null string
+ if ( line->len == 0 )
+ return NULL;
+ else
break;
@@ -104,2 +110,3 @@ char * mailstream_read_line_append(mailstream * stream, MMAPString * line)
}
+ }
while (1);