summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2005-11-07 09:23:31 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2005-11-07 09:23:31 +0000
commitb7224d321f9325f36fb6b9e124dfa8c4e37ae2c0 (patch)
tree64adb046bfbceb306972bb109e030924afec4d93
parentfa603d41674c6b412da07a3272964a229486863d (diff)
downloadrsyslog-b7224d321f9325f36fb6b9e124dfa8c4e37ae2c0.tar.gz
rsyslog-b7224d321f9325f36fb6b9e124dfa8c4e37ae2c0.tar.xz
rsyslog-b7224d321f9325f36fb6b9e124dfa8c4e37ae2c0.zip
fixed bugs in TCP sender, init() and message parsing. Some could cause
rsyslogd to dump core.
-rw-r--r--NEWS5
-rw-r--r--syslogd.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 71f99cfb..4823e01b 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,11 @@ Version 1.0.3 (RGer), 2005-10-10
unlikely)
- fixed an one-too-low memory allocation in the TCP sender. Could result
in rsyslogd dumping core.
+- fixed a bug in the TCP sender that caused the retry logic to fail
+ after an error or receiver overrun
+- fixed a bug in init() that could lead to dumping core
+- fixed a bug that could lead to dumping core when no HOSTNAME or no TAG
+ was present in the syslog message
---------------------------------------------------------------------------
Version 1.0.2 (RGer), 2005-10-05
- fixed an issue with MySQL error reporting. When an error occured,
diff --git a/syslogd.c b/syslogd.c
index 3b717f22..fbb896d5 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -1008,8 +1008,8 @@ int TCPSend(struct filed *f, char *msg)
if(f->f_un.f_forw.savedMsg == NULL)
return 0; /* nothing we can do... */
memcpy(f->f_un.f_forw.savedMsg, msg, len + 1);
- return 0;
}
+ return 0;
} else if(f->f_un.f_forw.status != TCP_SEND_READY)
/* This here is debatable. For the time being, we
* accept the loss of a single message (e.g. during
@@ -1867,8 +1867,7 @@ int MsgSetHOSTNAME(struct msg *pMsg, char* pszHOSTNAME)
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;
}
@@ -4463,6 +4462,7 @@ void init()
Initialized = 0;
if ( nlogs > -1 )
{
+ struct filed *fPrev;
dprintf("Initializing log structures.\n");
f = Files;
@@ -4498,8 +4498,9 @@ void init()
#endif
}
/* done with this entry, we now need to delete itself */
+ fPrev = f;
f = f->f_next;
- free(f);
+ free(fPrev);
}
/* Reflect the deletion of the Files linked list. */