[System.Net.Http] HttpClient timeout range checks. Fixes #25755
[mono.git] / mcs / class / System.Net.Http / System.Net.Http / HttpClient.cs
index baa6dd9f0d26cc6a219c5187164013043009be9d..c9fd2354abe136be56708c73b9a2bf30ff6f2098 100644 (file)
@@ -96,7 +96,7 @@ namespace System.Net.Http
                                return timeout;
                        }
                        set {
-                               if (value != System.Threading.Timeout.InfiniteTimeSpan && value < TimeSpan.Zero)
+                               if (value != System.Threading.Timeout.InfiniteTimeSpan && (value <= TimeSpan.Zero || value.Ticks > int.MaxValue))
                                        throw new ArgumentOutOfRangeException ();
 
                                timeout = value;