Skip to content

Conversation

practicalswift
Copy link
Contributor

Add fuzzing harnesses for functions in addrdb.h, net_permissions.h and timedata.h.

@fanquake fanquake added the Tests label Mar 24, 2020
(void)median_filter.median();
assert(median_filter.size() > 0);
assert(static_cast<size_t>(median_filter.size()) == median_filter.sorted().size());
assert(static_cast<unsigned int>(median_filter.size()) <= max_size || max_size == 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Suggested change
assert(static_cast<unsigned int>(median_filter.size()) <= max_size || max_size == 0);
assert(static_cast<unsigned int>(median_filter.size()) <= max_size);

Copy link
Contributor Author

@practicalswift practicalswift Mar 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is needed since max_size == 0 means unbounded size as CMedianFilter is currently implemented :)

}
return CBanEntry{};
}();
assert(!ban_entry.banReasonToString().empty());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to also add an AssertEqualAfterSerializeDeserialize here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid equality is not defined for CBanEntry. That goes for quite a few of our classes :)

@maflcko maflcko merged commit 5236b2e into bitcoin:master Mar 24, 2020
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Aug 6, 2020
…data.h

Summary:
bitcoin/bitcoin@43ff0d9

---

Depends on D7133

Partial backport of Core [[bitcoin/bitcoin#18417 | PR18417]]

Test Plan:
  cmake -GNinja .. -DENABLE_SANITIZERS="address;fuzzer" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
  ninja bitcoin-fuzzers
  ./src/test/fuzz/timedata

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D7134
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Aug 6, 2020
…permissions.h

Summary:
bitcoin/bitcoin@4308aa6

---

Depends on D7134

Concludes backport of Core [[bitcoin/bitcoin#18417 | PR18417]]

Test Plan:
  cmake -GNinja .. -DENABLE_SANITIZERS="address;fuzzer" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
  ninja bitcoin-fuzzers
  ./src/test/fuzz/net_permissions

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D7135
@practicalswift practicalswift deleted the fuzzers-misc branch April 10, 2021 19:40
kwvg added a commit to kwvg/dash that referenced this pull request May 7, 2022
kwvg added a commit to kwvg/dash that referenced this pull request May 7, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Jun 14, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Jun 14, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Jun 18, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Jul 4, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Jul 6, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Jul 6, 2022
knst pushed a commit to knst/dash that referenced this pull request Jul 21, 2022
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants