summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-03-01 14:23:21 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-03-01 14:23:21 +0100
commitbd73f263b310c29d5e0b0dd541403bde44030b86 (patch)
treed01694447df52c249833767e48f6dd6be00338a3 /runtime
parent5b1cd3330196c5ffa2b8695798946aa2441b7e84 (diff)
downloadrsyslog-bd73f263b310c29d5e0b0dd541403bde44030b86.tar.gz
rsyslog-bd73f263b310c29d5e0b0dd541403bde44030b86.tar.xz
rsyslog-bd73f263b310c29d5e0b0dd541403bde44030b86.zip
bugfix: potential abort condition when $RepeatedMsgReduction set to on
as well as potentially in a number of other places where MsgDup() was used. This only happened when the imudp input module was used and it depended on name resolution not yet had taken place. In other words, this was a strange problem that could lead to hard to diagnose instability. So if you experience instability, chances are good that this fix will help.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/msg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/msg.c b/runtime/msg.c
index fb4d5742..b0261faa 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -932,13 +932,14 @@ msg_t* MsgDup(msg_t* pOld)
pNew->iLenMSG = pOld->iLenMSG;
pNew->iLenTAG = pOld->iLenTAG;
pNew->iLenHOSTNAME = pOld->iLenHOSTNAME;
- if((pOld->msgFlags & NEEDS_DNSRESOL) == 1) {
+ if((pOld->msgFlags & NEEDS_DNSRESOL)) {
localRet = msgSetFromSockinfo(pNew, pOld->rcvFrom.pfrominet);
if(localRet != RS_RET_OK) {
/* if something fails, we accept loss of this property, it is
* better than losing the whole message.
*/
pNew->msgFlags &= ~NEEDS_DNSRESOL;
+ pNew->rcvFrom.pRcvFrom = NULL; /* make sure no dangling values */
}
} else {
if(pOld->rcvFrom.pRcvFrom != NULL) {