Merge bitcoin/bitcoin#29413: fuzz: increase length of string used for NetWhitelist{bind}Permissions::TryParse

864e2e9097 fuzz: increase length of string used for `NetWhitelist{bind}Permissions::TryParse` (brunoerg)

Pull request description:

  The string `s` represents the value from `-whitelist`/`-whitebind` (e.g. "bloom,forcerelay,noban@1.2.3.4:32") and it is used in `NetWhitelistPermissions::TryParse` and `NetWhitebindPermissions::TryParse`. However, a max length of 32 is not enough to cover a lot of cases. Even disconsidering the permissions, 32 would not be enough to cover a lot of addresses. This PR fixes it.

ACKs for top commit:
  maflcko:
    lgtm ACK 864e2e9097
  epiccurious:
    utACK 864e2e9097.
  vasild:
    ACK 864e2e9097

Tree-SHA512: 2b89031b9f2ea92d636f05fd167b1e5ac726742a7e7c1af8ddaeaf90236e659731aaa6b7c23f65ec16ce52ac1b9e68e7b16e23c59e355312d057e001976d172a
This commit is contained in:
fanquake 2024-02-13 11:46:56 -03:00
commit d7dabdbfcd
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -17,7 +17,7 @@
FUZZ_TARGET(net_permissions)
{
FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
const std::string s = fuzzed_data_provider.ConsumeRandomLengthString(32);
const std::string s = fuzzed_data_provider.ConsumeRandomLengthString(1000);
const NetPermissionFlags net_permission_flags = ConsumeWeakEnum(fuzzed_data_provider, ALL_NET_PERMISSION_FLAGS);
NetWhitebindPermissions net_whitebind_permissions;