summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-09-10 15:37:22 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-09-10 15:37:22 +0200
commitde10acc9db91b331b096d74adf355c6f1956484f (patch)
tree17b8398c37ae537b89a087014c0e005d26f10ee0
parent6e1f0d4f70073b4a52f94d7bfe7afa82a3b5075e (diff)
parent78e9c7c4d2c4ec09cce403066f09a5a7e08e994e (diff)
downloadrsyslog-de10acc9db91b331b096d74adf355c6f1956484f.tar.gz
rsyslog-de10acc9db91b331b096d74adf355c6f1956484f.tar.xz
rsyslog-de10acc9db91b331b096d74adf355c6f1956484f.zip
Merge branch 'v4-beta' into beta
Conflicts: action.c
-rw-r--r--ChangeLog7
-rw-r--r--runtime/msg.c11
2 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 8d672163..6b0ebc92 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -111,6 +111,13 @@ increase.
output module interface
---------------------------------------------------------------------------
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;
}