From a6f08b4783646deacc72fc700613ff150fa65d36 Mon Sep 17 00:00:00 2001 From: Nick Terrell Date: Wed, 13 Sep 2017 18:41:32 -0700 Subject: [PATCH] [fuzzer] Fix FUZZ_seed() --- tests/fuzz/fuzz_helpers.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/fuzz/fuzz_helpers.h b/tests/fuzz/fuzz_helpers.h index d93881c8..cb3421bb 100644 --- a/tests/fuzz/fuzz_helpers.h +++ b/tests/fuzz/fuzz_helpers.h @@ -55,10 +55,11 @@ extern "C" { * Consumes up to the first FUZZ_RNG_SEED_SIZE bytes of the input. */ FUZZ_STATIC uint32_t FUZZ_seed(uint8_t const **src, size_t* size) { + uint8_t const *data = *src; size_t const toHash = MIN(FUZZ_RNG_SEED_SIZE, *size); - return XXH32(*src, toHash, 0); *size -= toHash; *src += toHash; + return XXH32(data, toHash, 0); } #define FUZZ_rotl32(x, r) (((x) << (r)) | ((x) >> (32 - (r))))