Skip to content

Commit

Permalink
Merge pull request arximboldi#152 from arximboldi/oss-fuzz-bugs
Browse files Browse the repository at this point in the history
Fix crash 5078027885871104
  • Loading branch information
arximboldi authored Jul 28, 2020
2 parents ce38787 + 7b2e1db commit c143f6d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions immer/detail/rbts/operations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1751,9 +1751,9 @@ struct concat_rebalance_plan
const auto branches = count_t{1} << bits;
const auto optimal = ((total - 1) >> bits) + 1;
count_t i = 0;
while (n > optimal + rrb_extras) {
while (n >= optimal + rrb_extras) {
// skip ok nodes
while (counts[i] >= branches - rrb_invariant)
while (counts[i] > branches - rrb_invariant)
i++;
assert(i < n);
// short node, redistribute
Expand Down
Binary file not shown.
11 changes: 11 additions & 0 deletions test/oss-fuzz/flex-vector-0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,14 @@ TEST_CASE("https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24147")
CHECK(run_input(input.data(), input.size()) == 0);
}
}

TEST_CASE("https://oss-fuzz.com/testcase-detail/5078027885871104")
{
SECTION("fuzzer")
{
return;
auto input = load_input(
"clusterfuzz-testcase-minimized-flex-vector-5078027885871104.fuzz");
CHECK(run_input(input.data(), input.size()) == 0);
}
}

0 comments on commit c143f6d

Please sign in to comment.