diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2005-11-04 14:49:01 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2005-11-04 14:49:01 +0000 |
commit | 0c02fd440101bf7225cea03dc802715174be7e44 (patch) | |
tree | e2b458a8930d5b9f82a59e480fa7ea79a92cf55a /syslogd.c | |
parent | 892e359dceee0e99ced947d1bdb512e7a5733312 (diff) | |
download | rsyslog-0c02fd440101bf7225cea03dc802715174be7e44.tar.gz rsyslog-0c02fd440101bf7225cea03dc802715174be7e44.tar.xz rsyslog-0c02fd440101bf7225cea03dc802715174be7e44.zip |
fixed a bug causing core dump when no TAG was in message
Diffstat (limited to 'syslogd.c')
-rw-r--r-- | syslogd.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 ... */ |