-rw-r--r-- | kmicromail/libetpan/tools/mailstream_helper.c | 11 |
1 files changed, 9 insertions, 2 deletions
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 @@ -98,8 +98,15 @@ char * mailstream_read_line_append(mailstream * stream, MMAPString * line) if (r == -1) return NULL; - if (r == 0) - break; + 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; + } } } while (1); |