summaryrefslogtreecommitdiffabout
path: root/libetpan
authorzautrix <zautrix>2005-03-18 22:05:02 (UTC)
committer zautrix <zautrix>2005-03-18 22:05:02 (UTC)
commit297208a61298fceab6d96bbd1c46198b1c0f7a76 (patch) (side-by-side diff)
tree50f0c6f775393c1eec15b71691a798d1dacab86d /libetpan
parentf0232b7801f098b5842e3cd5a1fd804af98ab862 (diff)
downloadkdepimpi-297208a61298fceab6d96bbd1c46198b1c0f7a76.zip
kdepimpi-297208a61298fceab6d96bbd1c46198b1c0f7a76.tar.gz
kdepimpi-297208a61298fceab6d96bbd1c46198b1c0f7a76.tar.bz2
fixes applied
Diffstat (limited to 'libetpan') (more/less context) (show whitespace changes)
-rw-r--r--libetpan/src/data-types/mailstream_helper.c9
-rw-r--r--libetpan/src/driver/implementation/pop3/pop3driver.c6
-rw-r--r--libetpan/src/low-level/imap/mailimap_parser.c20
-rw-r--r--libetpan/src/low-level/maildir/maildir.c15
-rw-r--r--libetpan/src/low-level/mh/mailmh.c3
-rw-r--r--libetpan/src/low-level/pop3/mailpop3.c5
6 files changed, 54 insertions, 4 deletions
diff --git a/libetpan/src/data-types/mailstream_helper.c b/libetpan/src/data-types/mailstream_helper.c
index 2f0b9ae..f0ddf51 100644
--- a/libetpan/src/data-types/mailstream_helper.c
+++ b/libetpan/src/data-types/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);
diff --git a/libetpan/src/driver/implementation/pop3/pop3driver.c b/libetpan/src/driver/implementation/pop3/pop3driver.c
index ea69923..6cc6a9a 100644
--- a/libetpan/src/driver/implementation/pop3/pop3driver.c
+++ b/libetpan/src/driver/implementation/pop3/pop3driver.c
@@ -251,2 +251,4 @@ static int pop3driver_login(mailsession * session,
int r;
+ //LR
+ int ret;
carray * msg_tab;
@@ -273,3 +275,7 @@ static int pop3driver_login(mailsession * session,
+ // LR 2 lines
+ ret = pop3driver_pop3_error_to_mail_error(r);
+ if ( ret == MAIL_NO_ERROR )
mailpop3_list(get_pop3_session(session), &msg_tab);
+ // LR
diff --git a/libetpan/src/low-level/imap/mailimap_parser.c b/libetpan/src/low-level/imap/mailimap_parser.c
index ab4db67..071891c 100644
--- a/libetpan/src/low-level/imap/mailimap_parser.c
+++ b/libetpan/src/low-level/imap/mailimap_parser.c
@@ -2401,5 +2401,23 @@ mailimap_body_fld_enc_parse(mailstream * fd, MMAPString * buffer,
if (r != MAILIMAP_NO_ERROR) {
- res = r;
+ // LR start
+ // accept NIL and set type to utf8
+ int ret = r;
+ r = mailimap_char_parse(fd, buffer, &cur_token, 'N');
+ if (r == MAILIMAP_NO_ERROR) {
+ r = mailimap_char_parse(fd, buffer, &cur_token, 'I');
+ if (r == MAILIMAP_NO_ERROR) {
+ r = mailimap_char_parse(fd, buffer, &cur_token, 'L');
+ if (r == MAILIMAP_NO_ERROR) {
+ type = 4;
+ ret = MAILIMAP_NO_ERROR;
+ value = NULL;
+ }
+ }
+ }
+ if ( ret != MAILIMAP_NO_ERROR ) {
+ res = ret;
goto err;
}
+ // LR end
+ }
}
diff --git a/libetpan/src/low-level/maildir/maildir.c b/libetpan/src/low-level/maildir/maildir.c
index 98b9f87..e81625d 100644
--- a/libetpan/src/low-level/maildir/maildir.c
+++ b/libetpan/src/low-level/maildir/maildir.c
@@ -112,2 +112,4 @@ static char * maildir_get_new_message_filename(struct maildir * md,
time_t now;
+ //LR
+ struct stat f_stat;
int got_file;
@@ -124,2 +126,13 @@ static char * maildir_get_new_message_filename(struct maildir * md,
+ // LR changed following lines
+ if ( stat( filename, &f_stat ) == -1 ) {
+ char * dup_filename;
+
+ dup_filename = strdup(filename);
+ if (dup_filename == NULL) {
+ //unlink(filename);
+ return NULL;
+ }
+ rename (tmpfile,dup_filename );
+#if 0
if (link(tmpfile, filename) == 0) {
@@ -149,3 +162,3 @@ static char * maildir_get_new_message_filename(struct maildir * md,
}
-
+#endif
md->mdir_counter ++;
diff --git a/libetpan/src/low-level/mh/mailmh.c b/libetpan/src/low-level/mh/mailmh.c
index 42cab9d..f8c694d 100644
--- a/libetpan/src/low-level/mh/mailmh.c
+++ b/libetpan/src/low-level/mh/mailmh.c
@@ -922,2 +922,5 @@ int mailmh_folder_remove_message(struct mailmh_folder * folder,
}
+ // LR memory leak fixed
+ mailmh_msg_info_free( msg_info );
+ free(filename);
diff --git a/libetpan/src/low-level/pop3/mailpop3.c b/libetpan/src/low-level/pop3/mailpop3.c
index 6f77a3a..bca62d5 100644
--- a/libetpan/src/low-level/pop3/mailpop3.c
+++ b/libetpan/src/low-level/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;
+ }