From d45d293d045a8d0f68e09ff9414e2dd6d18dd651 Mon Sep 17 00:00:00 2001 From: zautrix Date: Fri, 11 Feb 2005 17:11:53 +0000 Subject: fixi --- (limited to 'kmicromail/libetpan/tools/mailstream_helper.c') 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); -- cgit v0.9.0.2