• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include <stddef.h>
6 #include <stdint.h>
7 
8 #include "base/hash/sha1.h"
9 
10 // Entry point for LibFuzzer.
LLVMFuzzerTestOneInput(const uint8_t * data_ptr,size_t size)11 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data_ptr, size_t size) {
12   // SAFETY: libfuzzer gives a valid pointer and size pair.
13   auto data = UNSAFE_BUFFERS(base::span(data_ptr, size));
14   base::SHA1Digest sha1 = base::SHA1Hash(data);
15   (void)sha1;
16   return 0;
17 }
18