Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcos Henrich <marcos.henrich@xamarin.com>2015-03-12 11:57:07 +0300
committerMarcos Henrich <marcos.henrich@xamarin.com>2015-03-12 15:46:17 +0300
commitbc7b4e330aa429487a622d36f5cac3db059e67ab (patch)
treeee46800ce424adabbf65c9c273859439bd06c413 /mcs/class/corlib
parent9f0f929a979e48c06dd34f322d0dcd117dfacf1a (diff)
[corlib] Fixed DateTime overflow check in TimeZoneInfo.
Diffstat (limited to 'mcs/class/corlib')
-rw-r--r--mcs/class/corlib/System/TimeZoneInfo.cs3
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;
}