Extend values saved in hash data structure to u_int64_t (#3013)

Move from `u_int32_t` to `u_int64_t`.
We want to be able to save protocol + category + breed in the same
entry.
This commit is contained in:
Ivan Nardi 2025-10-24 17:58:08 +02:00 committed by GitHub
parent 4f18701b99
commit 20892cf4fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 33 additions and 33 deletions

View file

@ -9,7 +9,7 @@
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
FuzzedDataProvider fuzzed_data(data, size);
u_int16_t i, rc, num_iteration, data_len, is_added = 0;
u_int32_t value32;
u_int64_t value64;
std::vector<char>value_added;
ndpi_str_hash *h = NULL;
@ -45,11 +45,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
data_len = fuzzed_data.ConsumeIntegralInRange(0, 127);
std::vector<char>data = fuzzed_data.ConsumeBytes<char>(data_len);
ndpi_hash_find_entry(h, data.data(), data.size(), &value32);
ndpi_hash_find_entry(h, data.data(), data.size(), &value64);
}
/* Search of an added entry */
if (is_added) {
ndpi_hash_find_entry(h, value_added.data(), value_added.size(), &value32);
ndpi_hash_find_entry(h, value_added.data(), value_added.size(), &value64);
}
if (fuzzed_data.ConsumeBool())