X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmsgbase.c;h=8421dfc1133789bfd14e1d4ad07761fd0b62fa21;hb=7823515de1fd4ecd7bde64f93b160c92c150653b;hp=a88a76369b5622251daf366d98fa0564bfd8b199;hpb=e047988e5cb07d89edeec13afea5c25a52ef26c6;p=citadel.git diff --git a/citadel/msgbase.c b/citadel/msgbase.c index a88a76369..8421dfc11 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -19,7 +19,6 @@ #include #include #include -#include "md5.h" #include "ctdl_module.h" #include "citserver.h" #include "control.h" @@ -1109,6 +1108,9 @@ struct CtdlMessage *CtdlDeserializeMessage(long msgnum, int with_body, const cha mptr = Buffer; upper_bound = Buffer + Length; + if (msgnum <= 0) { + return NULL; + } /* Parse the three bytes that begin EVERY message on disk. * The first is always 0xFF, the on-disk magic number. @@ -1308,7 +1310,7 @@ void fixed_output(char *name, char *filename, char *partnum, char *disp, } if (!strcasecmp(cbtype, "text/html")) { - ptr = html_to_ascii(content, length, 80, 0); + ptr = html_to_ascii(content, length, 80); wlen = strlen(ptr); client_write(ptr, wlen); if ((wlen > 0) && (ptr[wlen-1] != '\n')) { @@ -3106,13 +3108,9 @@ StrBuf *CtdlReadMessageBodyBuf(char *terminator, /* token signalling EOT */ } /* Unescape SMTP-style input of two dots at the beginning of the line */ - if ((dotdot) && - (StrLength(LineBuf) == 2) && - (!strcmp(ChrPtr(LineBuf), ".."))) - { + if ((dotdot) && (StrLength(LineBuf) > 1) && (ChrPtr(LineBuf)[0] == '.')) { StrBufCutLeft(LineBuf, 1); } - StrBufAppendBuf(Message, LineBuf, 0); }