diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-21 14:48:39 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-12-21 14:48:39 +0000 |
commit | 3a554fc5954cdcaac9a2af02719735efeba0e392 (patch) | |
tree | 2d502572b00dd8bc08361c2f03dc4f486979f856 /src/ragel | |
parent | 81e8e5e413ad8ba9dfb8b8f7da5ab2939dac4534 (diff) | |
download | rspamd-3a554fc5954cdcaac9a2af02719735efeba0e392.tar.gz rspamd-3a554fc5954cdcaac9a2af02719735efeba0e392.zip |
[Fix] Couple of fixes for date parsing
Diffstat (limited to 'src/ragel')
-rw-r--r-- | src/ragel/smtp_date.rl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ragel/smtp_date.rl b/src/ragel/smtp_date.rl index 23ab3caba..25e1ea3c0 100644 --- a/src/ragel/smtp_date.rl +++ b/src/ragel/smtp_date.rl @@ -31,10 +31,10 @@ gulong n; if (rspamd_strtoul (tmp, p - tmp, &n)) { if (n < 1000) { - tm.tm_year = n + 1900; + tm.tm_year = n; } else { - tm.tm_year = n; + tm.tm_year = n - 1900; } } } @@ -172,12 +172,12 @@ day_name = "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat" | "Sun"; day_of_week = FWS? day_name; - day = FWS? digit{1,2} FWS; + day = FWS? digit{1,2} >Day_Start %Day_End FWS; month = "Jan" %Month_Jan | "Feb" %Month_Feb | "Mar" %Month_Mar | "Apr" %Month_Apr | "May" %Month_May | "Jun" %Month_Jun | "Jul" %Month_Jul | "Aug" %Month_Aug | "Sep" %Month_Sep | "Oct" %Month_Oct | "Nov" %Month_Nov | "Dec" %Month_Dec; - year = FWS digit{2,} FWS; - date = day >Day_Start %Day_End month %Month_End year >Year_Start %Year_End; + year = FWS digit{2,4} >Year_Start %Year_End FWS; + date = day month %Month_End year; hour = digit_2; minute = digit_2; second = digit_2; |