summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-09-10 15:38:14 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-09-10 15:38:14 +0200
commit5515dd74951a98de323d42d45de96a20f4e4d55c (patch)
treeefced48932eb04644284182f52f39bfabdb7bb1a
parent000a9e0c7df248c10410554765086a7e45ccc6b4 (diff)
parentde10acc9db91b331b096d74adf355c6f1956484f (diff)
downloadrsyslog-5515dd74951a98de323d42d45de96a20f4e4d55c.tar.gz
rsyslog-5515dd74951a98de323d42d45de96a20f4e4d55c.tar.xz
rsyslog-5515dd74951a98de323d42d45de96a20f4e4d55c.zip
Merge branch 'beta'
-rw-r--r--ChangeLog7
-rw-r--r--runtime/msg.c11
2 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 0e36da85..fbfe33e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -127,6 +127,13 @@ Version 4.7.0 [v4-devel] (rgerhards), 2009-09-??
ticket http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=463793
---------------------------------------------------------------------------
Version 4.5.3 [v4-beta] (rgerhards), 2009-08-??
+- bugfix: repeated messages were incorrectly processed
+ this could lead to loss of the repeated message content. As a side-
+ effect, it could probably also be possible that some segfault occurs
+ (quite unlikely). The root cause was that some counters introduced
+ during the malloc optimizations were not properly duplicated in
+ MsgDup(). Note that repeated message processing is not enabled
+ by default.
- bugfix: message sanitation had some issues:
- control character DEL was not properly escaped
- NUL and LF characters were not properly stripped if no control
diff --git a/runtime/msg.c b/runtime/msg.c
index 8a72a6d6..8beb9c32 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -864,13 +864,17 @@ msg_t* MsgDup(msg_t* pOld)
pNew->iProtocolVersion = pOld->iProtocolVersion;
pNew->ttGenTime = pOld->ttGenTime;
pNew->offMSG = pOld->offMSG;
+ pNew->iLenRawMsg = pOld->iLenRawMsg;
+ pNew->iLenMSG = pOld->iLenMSG;
+ pNew->iLenTAG = pOld->iLenTAG;
+ pNew->iLenHOSTNAME = pOld->iLenHOSTNAME;
if(pOld->pRcvFrom != NULL) {
pNew->pRcvFrom = pOld->pRcvFrom;
prop.AddRef(pNew->pRcvFrom);
}
if(pOld->pRcvFromIP != NULL) {
pNew->pRcvFromIP = pOld->pRcvFromIP;
- prop.AddRef(pNew->pRcvFromIP); /* XXX */
+ prop.AddRef(pNew->pRcvFromIP);
}
if(pOld->pInputName != NULL) {
pNew->pInputName = pOld->pInputName;
@@ -1978,10 +1982,11 @@ rsRetVal MsgReplaceMSG(msg_t *pThis, uchar* pszMSG, int lenMSG)
lenNew = pThis->iLenRawMsg + lenMSG - pThis->iLenMSG;
if(lenMSG > pThis->iLenMSG && lenNew >= CONF_RAWMSG_BUFSIZE) {
- /* we have lost and need to alloc a new buffer ;) */
+ /* we have lost our "bet" and need to alloc a new buffer ;) */
CHKmalloc(bufNew = malloc(lenNew + 1));
memcpy(bufNew, pThis->pszRawMsg, pThis->offMSG);
- free(pThis->pszRawMsg);
+ if(pThis->pszRawMsg != pThis->szRawMsg)
+ free(pThis->pszRawMsg);
pThis->pszRawMsg = bufNew;
}