summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2005-11-04 14:49:01 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2005-11-04 14:49:01 +0000
commit0c02fd440101bf7225cea03dc802715174be7e44 (patch)
treee2b458a8930d5b9f82a59e480fa7ea79a92cf55a
parent892e359dceee0e99ced947d1bdb512e7a5733312 (diff)
downloadrsyslog-0c02fd440101bf7225cea03dc802715174be7e44.tar.gz
rsyslog-0c02fd440101bf7225cea03dc802715174be7e44.tar.xz
rsyslog-0c02fd440101bf7225cea03dc802715174be7e44.zip
fixed a bug causing core dump when no TAG was in message
-rw-r--r--NEWS4
-rw-r--r--syslogd.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index b1114bb1..815f0c8c 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,10 @@ Version 1.12.1 (RGer), 2005-10-??
restructured. Also, there might be a slight delay of up to 10 seconds
when huping and terminating rsyslogd under BSD
- fixed a bug where a NULL-pointer was passed to printf() in logmsg().
+- fixed a bug during "make install" where rc3195d was not installed
+ Thanks to Bennett Todd for spotting this.
+- fixed a bug where rsyslogd dumped core when no TAG was found in the
+ received message
---------------------------------------------------------------------------
Version 1.12.0 (RGer), 2005-10-26
- moved to a multi-threaded design. single-threading is still optionally
diff --git a/syslogd.c b/syslogd.c
index 30ec2db2..f3b6ae14 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -2411,8 +2411,7 @@ static int MsgSetHOSTNAME(struct msg *pMsg, char* pszHOSTNAME)
static void MsgAssignTAG(struct msg *pMsg, char *pBuf)
{
assert(pMsg != NULL);
- assert(pBuf != NULL);
- pMsg->iLenTAG = strlen(pBuf);
+ pMsg->iLenTAG = (pBuf == NULL) ? 0 : strlen(pBuf);
pMsg->pszTAG = pBuf;
}
@@ -3767,6 +3766,7 @@ void logmsg(int pri, struct msg *pMsg, int flags)
rsCStrAppendChar(pStrB, ':');
}
rsCStrFinish(pStrB);
+
MsgAssignTAG(pMsg, rsCStrConvSzStrAndDestruct(pStrB));
} else {
/* we have no TAG, so we ... */