aboutsummaryrefslogtreecommitdiff
path: root/fuzz/fuzz_alg_bytestream.c
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2023-02-16 18:04:34 +0100
committerGitHub <noreply@github.com>2023-02-16 18:04:34 +0100
commit4075324e2b81c11254a28362942a477594be6b28 (patch)
tree6d2412efd764f97cfd3bdefd9ee623248b718efb /fuzz/fuzz_alg_bytestream.c
parent06d4f8c7e56816d20636dc3838fa3a9825ad2ac8 (diff)
fuzz: extend fuzz coverage (#1888)
Diffstat (limited to 'fuzz/fuzz_alg_bytestream.c')
-rw-r--r--fuzz/fuzz_alg_bytestream.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/fuzz/fuzz_alg_bytestream.c b/fuzz/fuzz_alg_bytestream.c
new file mode 100644
index 000000000..4096c9d9a
--- /dev/null
+++ b/fuzz/fuzz_alg_bytestream.c
@@ -0,0 +1,13 @@
+#include "ndpi_api.h"
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+ u_int16_t bytes_read;
+
+ /* No memory allocations involved */
+
+ ndpi_bytestream_to_number64(data, size, &bytes_read);
+ ndpi_bytestream_dec_or_hex_to_number64(data, size, &bytes_read);
+ ntohs_ndpi_bytestream_to_number(data, size, &bytes_read);
+
+ return 0;
+}