diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2010-02-25 14:42:21 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2010-02-25 14:42:21 +0100 |
commit | 0995bff5947340333466cf3ac9c6a6b403b32d18 (patch) | |
tree | 0e19cbbd0f63005497b1dbe08779f2947b6eca22 /runtime | |
parent | c8ebe623376bc025bf166ec333ac874c215de816 (diff) | |
parent | 76ded5e98bd51d5de306f21f8abd28ee3b006be2 (diff) | |
download | rsyslog-0995bff5947340333466cf3ac9c6a6b403b32d18.tar.gz rsyslog-0995bff5947340333466cf3ac9c6a6b403b32d18.tar.xz rsyslog-0995bff5947340333466cf3ac9c6a6b403b32d18.zip |
Merge branch 'v4-stable' into 'v5-beta'
Conflicts:
ChangeLog
configure.ac
doc/manual.html
tools/syslogd.c
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/datetime.c | 17 | ||||
-rw-r--r-- | runtime/rsyslog.h | 2 |
2 files changed, 13 insertions, 6 deletions
diff --git a/runtime/datetime.c b/runtime/datetime.c index 4ab4318d..47d7ac0e 100644 --- a/runtime/datetime.c +++ b/runtime/datetime.c @@ -309,11 +309,11 @@ ParseTIMESTAMP3339(struct syslogTime *pTime, uchar** ppszTS, int *pLenStr) } /* OK, we actually have a 3339 timestamp, so let's indicated this */ - if(lenStr > 0 && *pszTS == ' ') { + if(lenStr > 0) { + if(*pszTS != ' ') /* if it is not a space, it can not be a "good" time - 2010-02-22 rgerhards */ + ABORT_FINALIZE(RS_RET_INVLD_TIME); + ++pszTS; /* just skip past it */ --lenStr; - ++pszTS; - } else { - ABORT_FINALIZE(RS_RET_INVLD_TIME); } /* we had success, so update parse pointer and caller-provided timestamp */ @@ -528,6 +528,7 @@ ParseTIMESTAMP3164(struct syslogTime *pTime, uchar** ppszTS, int *pLenStr) if(lenStr == 0 || *pszTS++ != ' ') ABORT_FINALIZE(RS_RET_INVLD_TIME); + --lenStr; /* we accept a slightly malformed timestamp when receiving. This is * we accept one-digit days @@ -583,7 +584,13 @@ ParseTIMESTAMP3164(struct syslogTime *pTime, uchar** ppszTS, int *pLenStr) * invalid format, it occurs frequently enough (e.g. with Cisco devices) * to permit it as a valid case. -- rgerhards, 2008-09-12 */ - if(lenStr == 0 || *pszTS++ == ':') { + if(lenStr > 0 && *pszTS == ':') { + ++pszTS; /* just skip past it */ + --lenStr; + } + if(lenStr > 0) { + if(*pszTS != ' ') /* if it is not a space, it can not be a "good" time - 2010-02-22 rgerhards */ + ABORT_FINALIZE(RS_RET_INVLD_TIME); ++pszTS; /* just skip past it */ --lenStr; } diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h index a5e8cf5d..e5e89b1f 100644 --- a/runtime/rsyslog.h +++ b/runtime/rsyslog.h @@ -35,7 +35,7 @@ * value to the fixed size of the message object. */ #define CONF_TAG_MAXSIZE 512 /* a value that is deemed far too large for any valid TAG */ -#define CONF_TAG_HOSTNAME 512 /* a value that is deemed far too large for any valid HOSTNAME */ +#define CONF_HOSTNAME_MAXSIZE 512 /* a value that is deemed far too large for any valid HOSTNAME */ #define CONF_RAWMSG_BUFSIZE 101 #define CONF_TAG_BUFSIZE 32 #define CONF_HOSTNAME_BUFSIZE 32 |