• Daniel McArdle's avatar
    Handle extreme time_now value in BackoffEntrySerializer. · 1c3ccf0b
    Daniel McArdle authored
    Although it seems unlikely that the clock would ever return a positive
    or negative infinity value in real life, we need to help the fuzzer get
    over this bump.
    
    Under the hood, TimeBase::operator- was being invoked when we computed
    |backoff_duration = absolute_release_time - time_now|, and this
    operation was overflowing the int64_t. This CL converts the values to
    TimeDelta before subtracting. As a result, the subtraction now uses
    TimeDelta::operator-, ensuring the integer overflow does not occur via
    saturating math.
    
    Bug: 1083616
    Change-Id: I24481920a4dfc4b2f8bd57b106190879656ddc28
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2320416Reviewed-by: default avatarMaksim Orlovich <morlovich@chromium.org>
    Commit-Queue: Dan McArdle <dmcardle@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#792030}
    1c3ccf0b
backoff_entry_serializer.cc 3.96 KB