]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Smtp_date: Fix 2 digits years between 00 and 49
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 5 Oct 2020 18:52:37 +0000 (19:52 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 5 Oct 2020 18:52:37 +0000 (19:52 +0100)
Suggested by: @citrin

src/ragel/smtp_date.rl

index 90c34b9deb55b720f291edc45950819578fcd360..e873e44dea12520360792dd706081374f1d776c1 100644 (file)
       gulong n;
       if (rspamd_strtoul (tmp, p - tmp, &n)) {
         if (n < 1000) {
-          tm.tm_year = n;
+          if (n < 50) {
+            tm.tm_year = n - 1900 + 2000;
+          }
+          else {
+            tm.tm_year = n;
+          }
         }
         else {
           tm.tm_year = n - 1900;