X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmsgbase.c;h=8421dfc1133789bfd14e1d4ad07761fd0b62fa21;hb=7823515de1fd4ecd7bde64f93b160c92c150653b;hp=7f6b7c9dabecf7477a213aecbea99a1f67e1af03;hpb=4f91d5d6e8ab40320421406d735eb72c8ff9575e;p=citadel.git diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 7f6b7c9da..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. @@ -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); }