projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b10ebd5
)
MSG: safeguard: terminate the message buffer if we find an unclean message in the DB.
author
Wilfried Goesgens
<dothebart@citadel.org>
Fri, 15 Nov 2013 11:34:55 +0000
(12:34 +0100)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Fri, 15 Nov 2013 11:34:55 +0000
(12:34 +0100)
citadel/msgbase.c
patch
|
blob
|
history
diff --git
a/citadel/msgbase.c
b/citadel/msgbase.c
index 776680b6df7cd5dd04f16bd04979fe23cf07cff6..1fff6dc474d891ef3a838937d1d109f877a3f87f 100644
(file)
--- 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