* Returns a byte vector of specified size regardless of the number of remaining bytes available * from the fuzzer. Pads with zero value bytes if needed to achieve the specified size. */
| 259 | * from the fuzzer. Pads with zero value bytes if needed to achieve the specified size. |
| 260 | */ |
| 261 | [[nodiscard]] inline std::vector<uint8_t> ConsumeFixedLengthByteVector(FuzzedDataProvider& fuzzed_data_provider, const size_t length) noexcept |
| 262 | { |
| 263 | std::vector<uint8_t> result(length); |
| 264 | const std::vector<uint8_t> random_bytes = fuzzed_data_provider.ConsumeBytes<uint8_t>(length); |
| 265 | if (!random_bytes.empty()) { |
| 266 | std::memcpy(result.data(), random_bytes.data(), random_bytes.size()); |
| 267 | } |
| 268 | return result; |
| 269 | } |
| 270 | |
| 271 | CNetAddr ConsumeNetAddr(FuzzedDataProvider& fuzzed_data_provider) noexcept; |
| 272 |
no test coverage detected