diff options
author | Marcos Henrich <marcos.henrich@xamarin.com> | 2015-03-12 11:57:07 +0300 |
---|---|---|
committer | Marcos Henrich <marcos.henrich@xamarin.com> | 2015-03-12 15:46:17 +0300 |
commit | bc7b4e330aa429487a622d36f5cac3db059e67ab (patch) | |
tree | ee46800ce424adabbf65c9c273859439bd06c413 /mcs/class/corlib | |
parent | 9f0f929a979e48c06dd34f322d0dcd117dfacf1a (diff) |
[corlib] Fixed DateTime overflow check in TimeZoneInfo.
Diffstat (limited to 'mcs/class/corlib')
-rw-r--r-- | mcs/class/corlib/System/TimeZoneInfo.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mcs/class/corlib/System/TimeZoneInfo.cs b/mcs/class/corlib/System/TimeZoneInfo.cs index a6b4e5233a2..6288560400e 100644 --- a/mcs/class/corlib/System/TimeZoneInfo.cs +++ b/mcs/class/corlib/System/TimeZoneInfo.cs @@ -1054,7 +1054,8 @@ namespace System date = date.ToUniversalTime () + BaseUtcOffset; if (dateTime.Kind != DateTimeKind.Utc) { - if (date.Ticks < BaseUtcOffset.Ticks) + var ticks = date.Ticks - BaseUtcOffset.Ticks; + if (ticks < DateTime.MinValue.Ticks) return false; date = date - BaseUtcOffset; } |