Commit a8799f0a authored by Daniel McArdle's avatar Daniel McArdle Committed by Commit Bot

Weaken time comparison in net_backoff_entry_serializer_fuzzer.

The fuzzer found a test case that causes the BackoffEntry deserializer
to discard the absolute timeout and fall back on the relative timeout.

BackoffEntry::GetReleaseTime() is actually not guaranteed to equal the
original release time (before serialization). However, it is guaranteed
to be less than or equal to the original release time.

This CL weakens the fuzzer's property check accordingly.

Bug: 1085995
Change-Id: I1dafb08575e73b0548f973565145c8ba7890a33e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2324111Reviewed-by: default avatarMaksim Orlovich <morlovich@chromium.org>
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Cr-Commit-Position: refs/heads/master@{#794549}
parent 09dc3856
......@@ -110,14 +110,14 @@ void TestDeserialize(const ProtoTranslator& translator) {
// Due to fuzzy interpretation in BackoffEntrySerializer::
// DeserializeFromValue, we cannot assert that |*reserialized == *value|.
// Rather, we can deserialize |reserialized| and check that the result is
// equivalent to |entry|.
// Rather, we can deserialize |reserialized| and check that some weaker
// properties are preserved.
std::unique_ptr<BackoffEntry> entry_reparsed =
BackoffEntrySerializer::DeserializeFromValue(
*reserialized, &policy, &clock, translator.parse_time());
CHECK(entry_reparsed);
CHECK_EQ(entry->failure_count(), entry_reparsed->failure_count());
CHECK_EQ(entry->GetReleaseTime(), entry_reparsed->GetReleaseTime());
CHECK_EQ(entry_reparsed->failure_count(), entry->failure_count());
CHECK_LE(entry_reparsed->GetReleaseTime(), entry->GetReleaseTime());
}
// Tests the "serialize-deserialize" property. Serializes an arbitrary
......
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