From 32664c620247b3217e7f5832a2d925996ffcbc18 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 31 Jan 1999 23:30:29 +0000 Subject: [PATCH] * Added qpdecode.c to the distribution (decodes quoted-printable) * Finished the MIME parser * Gave MSG0 a reasonable behaviour for MIME messages --- citadel/ChangeLog | 5 +++++ citadel/mime_parser.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 2abd6e269..1a50c2fd4 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,3 +1,8 @@ +Sun Jan 31 18:29:18 EST 1999 Art Cancro + * Added qpdecode.c to the distribution (decodes quoted-printable) + * Finished the MIME parser + * Gave MSG0 a reasonable behaviour for MIME messages + Sat Jan 30 18:39:53 EST 1999 Art Cancro * Look for citadel.rc in current directory if not found elsewhere * More work on the MIME parser diff --git a/citadel/mime_parser.c b/citadel/mime_parser.c index 2b0d70710..bbed98eef 100644 --- a/citadel/mime_parser.c +++ b/citadel/mime_parser.c @@ -123,9 +123,10 @@ void mime_decode(char *partnum, * Allocate a buffer for the decoded data. The output buffer is the * same size as the input buffer; this assumes that the decoded data * will never be larger than the encoded data. This is a safe - * assumption with base64, uuencode, and quoted-printable. + * assumption with base64, uuencode, and quoted-printable. Just to + * be safe, we still pad the buffer a bit. */ - decoded = mallok(length); + decoded = mallok(length + 1024); if (decoded == NULL) { lprintf(5, "ERROR: cannot allocate memory.\n"); return; @@ -140,7 +141,7 @@ void mime_decode(char *partnum, } if (childpid == 0) { - /* close(2); FIX uncomment this when solid */ + close(2); /* send stdio to the pipes */ if (dup2(sendpipe[0], 0)<0) lprintf(5, "ERROR dup2()\n"); if (dup2(recvpipe[1], 1)<0) lprintf(5, "ERROR dup2()\n"); @@ -187,6 +188,7 @@ void mime_decode(char *partnum, if (bytes_recv > 0) CallBack(name, filename, partnum, disposition, decoded, content_type, bytes_recv); + phree(decoded); } -- 2.39.2