From: Nick Terrell Date: Thu, 14 Sep 2017 01:41:32 +0000 (-0700) Subject: [fuzzer] Fix FUZZ_seed() X-Git-Tag: fuzz-corpora2~7^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6f08b4783646deacc72fc700613ff150fa65d36;p=thirdparty%2Fzstd.git [fuzzer] Fix FUZZ_seed() --- diff --git a/tests/fuzz/fuzz_helpers.h b/tests/fuzz/fuzz_helpers.h index d93881c80..cb3421bb8 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))))