xref: /aosp_15_r20/external/regex-re2/util/fuzz.cc (revision ccdc9c3e24c519bfa4832a66aa2e83a52c19f295)
1 // Copyright 2016 The RE2 Authors.  All Rights Reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4 
5 #include <stddef.h>
6 #include <stdint.h>
7 #include <stdlib.h>
8 
9 // Entry point for libFuzzer.
10 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);
11 
main(int argc,char ** argv)12 int main(int argc, char** argv) {
13   uint8_t data[32];
14   for (int i = 0; i < 32; i++) {
15     for (int j = 0; j < 32; j++) {
16       data[j] = random() & 0xFF;
17     }
18     LLVMFuzzerTestOneInput(data, 32);
19   }
20   return 0;
21 }
22