summaryrefslogtreecommitdiffstats
path: root/runtime/datetime.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-10-01 16:54:34 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-10-01 16:54:34 +0200
commitcb9761627630dc8aeafbbfcfe091f87b66b5a92a (patch)
treed3db6668c167d0354bfdd3a1423f2e9da39c1175 /runtime/datetime.c
parente13537ce909e8e6ab0b9d404c1e4870980c6dacf (diff)
downloadrsyslog-cb9761627630dc8aeafbbfcfe091f87b66b5a92a.tar.gz
rsyslog-cb9761627630dc8aeafbbfcfe091f87b66b5a92a.tar.bz2
rsyslog-cb9761627630dc8aeafbbfcfe091f87b66b5a92a.zip
RFC5424 formatted messages with only structured data and no MSG part were improperly handled.
This was a regression of one of the last bugfixes, so no previously released version contained this bug (thus it does not show up in the ChangeLog).
Diffstat (limited to 'runtime/datetime.c')
-rw-r--r--runtime/datetime.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/datetime.c b/runtime/datetime.c
index fc56b27c..99caaf97 100644
--- a/runtime/datetime.c
+++ b/runtime/datetime.c
@@ -213,18 +213,21 @@ ParseTIMESTAMP3339(struct syslogTime *pTime, uchar** ppszTS, int *pLenStr)
*/
if(lenStr == 0 || *pszTS++ != '-')
ABORT_FINALIZE(RS_RET_INVLD_TIME);
+ --lenStr;
month = srSLMGParseInt32(&pszTS, &lenStr);
if(month < 1 || month > 12)
ABORT_FINALIZE(RS_RET_INVLD_TIME);
if(lenStr == 0 || *pszTS++ != '-')
ABORT_FINALIZE(RS_RET_INVLD_TIME);
+ --lenStr;
day = srSLMGParseInt32(&pszTS, &lenStr);
if(day < 1 || day > 31)
ABORT_FINALIZE(RS_RET_INVLD_TIME);
if(lenStr == 0 || *pszTS++ != 'T')
ABORT_FINALIZE(RS_RET_INVLD_TIME);
+ --lenStr;
hour = srSLMGParseInt32(&pszTS, &lenStr);
if(hour < 0 || hour > 23)
@@ -232,12 +235,14 @@ ParseTIMESTAMP3339(struct syslogTime *pTime, uchar** ppszTS, int *pLenStr)
if(lenStr == 0 || *pszTS++ != ':')
ABORT_FINALIZE(RS_RET_INVLD_TIME);
+ --lenStr;
minute = srSLMGParseInt32(&pszTS, &lenStr);
if(minute < 0 || minute > 59)
ABORT_FINALIZE(RS_RET_INVLD_TIME);
if(lenStr == 0 || *pszTS++ != ':')
ABORT_FINALIZE(RS_RET_INVLD_TIME);
+ --lenStr;
second = srSLMGParseInt32(&pszTS, &lenStr);
if(second < 0 || second > 60)
ABORT_FINALIZE(RS_RET_INVLD_TIME);