summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2005-10-25 09:38:08 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2005-10-25 09:38:08 +0000
commitfa603d41674c6b412da07a3272964a229486863d (patch)
treec4176135341bb509c715779c5e45e0068c4aa909
parent572570db2bbb83aa27c5e9a2acb74d0edac8109b (diff)
downloadrsyslog-fa603d41674c6b412da07a3272964a229486863d.tar.gz
rsyslog-fa603d41674c6b412da07a3272964a229486863d.tar.xz
rsyslog-fa603d41674c6b412da07a3272964a229486863d.zip
fixed two bugs: tcp sender could cause dump core; termination could cause
dump core
-rw-r--r--NEWS5
-rw-r--r--syslogd.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 73bb5cf3..71f99cfb 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,11 @@ Version 1.0.3 (RGer), 2005-10-10
processed - could lead to message loss in extreme cases
- applied some patches available from the sysklogd project to code
shared from there
+- fixed a bug that causes rsyslogd to dump core on termination when one
+ of the selector lines did not receive a message during the run (very
+ unlikely)
+- fixed an one-too-low memory allocation in the TCP sender. Could result
+ in rsyslogd dumping core.
---------------------------------------------------------------------------
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 d7d2e0db..3b717f22 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -1038,7 +1038,7 @@ int TCPSend(struct filed *f, char *msg)
if((*(msg+len-1) != '\n')) {
if(buf != NULL)
free(buf);
- if((buf = malloc((len + 1) * sizeof(char))) == NULL) {
+ if((buf = malloc((len + 2) * sizeof(char))) == NULL) {
/* extreme mem shortage, try to solve
* as good as we can. No point in calling
* any alarms, they might as well run out
@@ -4274,7 +4274,8 @@ void die(sig)
free(f->f_iov);
}
/* Now delete cached messages */
- MsgDestruct(f->f_pMsg);
+ if(f->f_pMsg != NULL)
+ MsgDestruct(f->f_pMsg);
#ifdef WITH_DB
if (f->f_type == F_MYSQL)
closeMySQL(f);