From 8a24ef994f6a3b0c1e86eff7efe12f23e962f09e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 5 Mar 2019 21:43:59 -0600 Subject: [PATCH] Fix bounds check in DateTime::from_time --- src/types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.rs b/src/types.rs index 2abe3a36..e0ed8006 100644 --- a/src/types.rs +++ b/src/types.rs @@ -110,7 +110,7 @@ impl DateTime { /// /// Returns `Err` when this object is out of bounds pub fn from_time(tm: ::time::Tm) -> Result { - if tm.tm_year >= 1980 && tm.tm_year <= 2107 + if tm.tm_year >= 80 && tm.tm_year <= 207 && tm.tm_mon >= 1 && tm.tm_mon <= 31 && tm.tm_mday >= 1 && tm.tm_mday <= 31 && tm.tm_hour >= 0 && tm.tm_hour <= 23