Commit 209ee469 authored by Daniel McArdle's avatar Daniel McArdle Committed by Commit Bot

Drop time comparison from BackoffEntry reader.

net_backoff_entry_serializer_fuzzer found a test case that causes the
second deserialize step in TestDeserialize() to fail. We CHECK that the
return value is truthy, but it is nullptr.

Prior to this CL, BackoffEntrySerializer::DeserializeFromValue() would
return nullptr when the parsed absolute release time was negative. There
are two reasons for removing this less-than-zero comparison:

  (1) It complicates the fuzzer's logic for predicting the return value.
  (2) The value comes from TimeBase::ToInternalValue(). We should not
      assume we understand the internal representation of a time value.

Bug: 1113344
Change-Id: I1e1e9d5a422d116e2f9682bab42b2acefb5a0fe1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2398902
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Reviewed-by: default avatarMaksim Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808499}
parent 84091f47
...@@ -80,8 +80,7 @@ std::unique_ptr<BackoffEntry> BackoffEntrySerializer::DeserializeFromValue( ...@@ -80,8 +80,7 @@ std::unique_ptr<BackoffEntry> BackoffEntrySerializer::DeserializeFromValue(
return nullptr; return nullptr;
int64_t absolute_release_time_us; int64_t absolute_release_time_us;
if (!base::StringToInt64(absolute_release_time_string, if (!base::StringToInt64(absolute_release_time_string,
&absolute_release_time_us) || &absolute_release_time_us)) {
absolute_release_time_us < 0) {
return nullptr; return nullptr;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment