From f03b26b550dc7a08f96753c47e8fb0673f5338ec Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Fri, 3 Jul 2009 10:33:35 +0200 Subject: bugfix: missing initialization during timestamp creation This could lead to timestamps written in the wrong format, but not to an abort. --- ChangeLog | 3 +++ runtime/datetime.c | 1 + runtime/syslogd-types.h | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 347afebb..9ecffe2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,9 @@ Version 4.5.0 [DEVEL] (rgerhards), 2009-07-02 was actually destructed. This most likely had no effect to existing code, but it may also have caused trouble in remote cases. Similarly, the fix may also cause trouble... +- bugfix: missing initialization during timestamp creation + This could lead to timestamps written in the wrong format, but not to + an abort --------------------------------------------------------------------------- Version 4.3.3 [beta] (rgerhards), 2009-0?-?? - internal bugfix: object pointer was only reset to NULL when an object diff --git a/runtime/datetime.c b/runtime/datetime.c index ea67eec5..2db1d3c5 100644 --- a/runtime/datetime.c +++ b/runtime/datetime.c @@ -123,6 +123,7 @@ static void getCurrTime(struct syslogTime *t, time_t *ttSeconds) t->OffsetMode = '+'; t->OffsetHour = lBias / 3600; t->OffsetMinute = lBias % 3600; + t->timeType = TIME_TYPE_RFC5424; /* we have a high precision timestamp */ } diff --git a/runtime/syslogd-types.h b/runtime/syslogd-types.h index 83b38f28..4a26f993 100644 --- a/runtime/syslogd-types.h +++ b/runtime/syslogd-types.h @@ -76,6 +76,10 @@ enum _EHostnameCmpMode { }; typedef enum _EHostnameCmpMode EHostnameCmpMode; +/* time type numerical values for structure below */ +#define TIME_TYPE_UNINIT 0 +#define TIME_TYPE_RFC3164 1 +#define TIME_TYPE_RFC5424 2 /* rgerhards 2004-11-11: the following structure represents * a time as it is used in syslog. * rgerhards, 2009-06-23: packed structure for better cache performance -- cgit v1.2.3