diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-10-09 07:48:22 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-10-09 07:48:22 +0200 |
commit | 5742f9cdd0da18a3ddfb0a51a981637124a6ab25 (patch) | |
tree | 008f8267a1d35ce3b768943228aa7e72bd0d85a4 | |
parent | ace4f2f75202aec39449dac11b9eb1deca7428d7 (diff) | |
download | rsyslog-5742f9cdd0da18a3ddfb0a51a981637124a6ab25.tar.gz rsyslog-5742f9cdd0da18a3ddfb0a51a981637124a6ab25.tar.xz rsyslog-5742f9cdd0da18a3ddfb0a51a981637124a6ab25.zip |
fixing segfault caused by all inputs but imudp
-rw-r--r-- | runtime/msg.c | 1 | ||||
-rw-r--r-- | tools/syslogd.c | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/runtime/msg.c b/runtime/msg.c index c030fa45..e52c9e3f 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -264,6 +264,7 @@ static inline rsRetVal msgBaseConstruct(msg_t **ppThis) /* initialize members that are non-zero */ pM->iRefCount = 1; + pM->bIsParsed = 1; /* first we assume this is parsed. If not, input must re-set to 0 */ pM->iSeverity = -1; pM->iFacility = -1; objConstructSetObjInfo(pM); diff --git a/tools/syslogd.c b/tools/syslogd.c index 1a26333d..a45942fa 100644 --- a/tools/syslogd.c +++ b/tools/syslogd.c @@ -597,13 +597,13 @@ static inline rsRetVal printline(uchar *hname, uchar *hnameIP, uchar *msg, int b int pri; msg_t *pMsg; - pMsg->bIsParsed = 1; /* this is a hack until this function can be removed TODO: do it soon (rgerhards, 2008-10-09)! */ /* Now it is time to create the message object (rgerhards) */ if(stTime == NULL) { CHKiRet(msgConstruct(&pMsg)); } else { CHKiRet(msgConstructWithTime(&pMsg, stTime, ttGenTime)); } + pMsg->bIsParsed = 1; /* this is a hack until this function can be removed TODO: do it soon (rgerhards, 2008-10-09)! */ if(pszInputName != NULL) MsgSetInputName(pMsg, (char*) pszInputName); MsgSetFlowControlType(pMsg, flowCtlType); @@ -1192,6 +1192,7 @@ msgConsumer(void __attribute__((unused)) *notNeeded, void *pUsr) assert(pMsg != NULL); +RUNLOG_VAR("%d", pMsg->bIsParsed); if(pMsg->bIsParsed == 0) { parseMsg(pMsg); } |