commit | bd216eec99ecf243216385b3bbc11d3776c2488b | [log] [tgz] |
---|---|---|
author | Qijiang Fan <fqj@chromium.org> | Wed Jun 17 04:41:41 2020 |
committer | Commit Bot <commit-bot@chromium.org> | Wed Jun 17 21:06:12 2020 |
tree | 1dd4ccfffcdd51bb27871accfe6eb219d88a6eb9 | |
parent | eaa616ec9e7bdd0bddd6244eb990f67b86e99ab9 [diff] |
base: ClampSub when convert from Windows epoch to UNIX epoch. In edge cases, When Time::FromTimeT is created with any number smaller than std::numeric_limit<time_t>::min() / 1000, Time internally saves us_ as std::numeric_limit<time_t>::min(). When converting back to UNIX epoch (microseconds based), it may overflow to large intergers. Use ClampSub to keep it as std::numeric_limit<time_t>::min(). BUG=chromium:1095771, chromium:1054279 TEST=CrashCommonUtilTest.IsOsTimestampTooOldForUploads with ubsan Change-Id: Ia93e99fcf78c6316c866a946d8b5716cacec09ec Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/external/libchrome/+/2249219 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Hidehiko Abe <hidehiko@chromium.org> Commit-Queue: Qijiang Fan <fqj@google.com> Commit-Queue: Manoj Gupta <manojgupta@chromium.org> Tested-by: Qijiang Fan <fqj@google.com>
This directory includes the source from Chrome's libbase for use in Chrome OS.
See libchrome.md for more info.