| Index: net/cookies/cookie_util.cc
|
| diff --git a/net/cookies/cookie_util.cc b/net/cookies/cookie_util.cc
|
| index 210b8d479af7bcafc3274746b321a0fc6915d26c..5a378064638309e729e685bbdf8532cf38d475b7 100644
|
| --- a/net/cookies/cookie_util.cc
|
| +++ b/net/cookies/cookie_util.cc
|
| @@ -205,7 +205,16 @@ base::Time ParseCookieTime(const std::string& time_string) {
|
| exploded.month >= 1 && exploded.month <= 12 &&
|
| exploded.year >= 1601 && exploded.year <= 30827 &&
|
| exploded.hour <= 23 && exploded.minute <= 59 && exploded.second <= 59) {
|
| - return base::Time::FromUTCExploded(exploded);
|
| + base::Time time;
|
| + if (!base::Time::FromUTCExploded(exploded, &time)) {
|
| + if (exploded.year > 1970) {
|
| + // Overflow occured in the platform time conversion. Let's
|
| + // used the largest possible time value.
|
| + time = base::Time::GetMaxPlatformTime();
|
| + LOG(WARNING) << "Parsed cookie time was clamped to " << time;
|
| + }
|
| + }
|
| + return time;
|
| }
|
|
|
| // One of our values was out of expected range. For well-formed input,
|
|
|