X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmsgbase.c;h=9b60f0966ed8c5704cc367bb7d85937e197bdaea;hb=8ddbd46ffb249a044bc483c338cdd280fe9efcb0;hp=776680b6df7cd5dd04f16bd04979fe23cf07cff6;hpb=4e9952daf6d736348f34fa1e02f33a568d25d894;p=citadel.git diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 776680b6d..9b60f0966 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -1129,6 +1129,13 @@ struct CtdlMessage *CtdlFetchMessage(long msgnum, int with_body) ret->cm_anon_type = *mptr++; /* Anon type byte */ ret->cm_format_type = *mptr++; /* Format type byte */ + + if (dmsgtext->ptr[dmsgtext->len - 1] != '\0') + { + MSG_syslog(LOG_ERR, "CtdlFetchMessage(%ld, %d) Forcefully terminating message!!\n", msgnum, with_body); + dmsgtext->ptr[dmsgtext->len - 1] = '\0'; + } + /* * The rest is zero or more arbitrary fields. Load them in. * We're done when we encounter either a zero-length field or @@ -3429,6 +3436,7 @@ struct CtdlMessage *CtdlMakeMessageLen( } StrBufRFC2047encode(&FakeEncAuthor, FakeAuthor); CM_SetAsFieldSB(msg, eAuthor, &FakeEncAuthor); + FreeStrBuf(&FakeAuthor); if (CCC->room.QRflags & QR_MAILBOX) { /* room */ CM_SetField(msg, eOriginalRoom, &CCC->room.QRname[11], strlen(&CCC->room.QRname[11]));