diff options
Diffstat (limited to 'ossfuzz/fuzz_data_producer.c')
-rw-r--r-- | ossfuzz/fuzz_data_producer.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ossfuzz/fuzz_data_producer.c b/ossfuzz/fuzz_data_producer.c index ae07575..992f5a7 100644 --- a/ossfuzz/fuzz_data_producer.c +++ b/ossfuzz/fuzz_data_producer.c @@ -1,7 +1,15 @@ #include "fuzz_data_producer.h" +struct FUZZ_dataProducer_s{ + const uint8_t *data; + size_t size; +}; + FUZZ_dataProducer_t *FUZZ_dataProducer_create(const uint8_t *data, size_t size) { FUZZ_dataProducer_t *producer = malloc(sizeof(FUZZ_dataProducer_t)); + + FUZZ_ASSERT(producer != NULL); + producer->data = data; producer->size = size; return producer; @@ -30,3 +38,7 @@ uint32_t FUZZ_dataProducer_uint32(FUZZ_dataProducer_t *producer, uint32_t min, return min + result % (range + 1); } + +size_t FUZZ_dataProducer_remainingBytes(FUZZ_dataProducer_t *producer){ + return producer->size; +} |