summaryrefslogtreecommitdiffstats
path: root/runtime/datetime.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-02-24 11:04:46 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-02-24 11:04:46 +0100
commitff0f04561286ba3635f128083b46501831368701 (patch)
tree70f79d74141338cf828af122827f9367cdbb6d44 /runtime/datetime.c
parentacebcd793e4898b524a9ea13b96c491aee4d67e2 (diff)
parent605701700a8914ebaff283193756a6e57d7d575b (diff)
downloadrsyslog-ff0f04561286ba3635f128083b46501831368701.tar.gz
rsyslog-ff0f04561286ba3635f128083b46501831368701.tar.xz
rsyslog-ff0f04561286ba3635f128083b46501831368701.zip
Merge branch 'v4-beta' into master
Conflicts: doc/manual.html tools/syslogd.c
Diffstat (limited to 'runtime/datetime.c')
-rw-r--r--runtime/datetime.c17
1 files changed, 12 insertions, 5 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;
}