/* ** This is a test interface for the ossfuzz.c module. The ossfuzz.c module ** is an adaptor for OSS-FUZZ. (https://github.com/google/oss-fuzz) ** ** This program links against ossfuzz.c. It reads files named on the ** command line and passes them one by one into ossfuzz.c. */ #include #if !defined(_MSC_VER) # include #endif #include #include #include #include "sqlite3.h" #if defined(_MSC_VER) typedef unsigned char uint8_t; #endif /* ** The entry point in ossfuzz.c that this routine will be calling */ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); /* Must match equivalent #defines in ossfuzz.c */ #define FUZZ_SQL_TRACE 0x0001 /* Set an sqlite3_trace() callback */ #define FUZZ_SHOW_MAX_DELAY 0x0002 /* Show maximum progress callback delay */ #define FUZZ_SHOW_ERRORS 0x0004 /* Show SQL errors */ extern void ossfuzz_set_debug_flags(unsigned); /* ** Read files named on the command-line and invoke the fuzzer for ** each one. */ int main(int argc, char **argv){ FILE *in; int i; int nErr = 0; uint8_t *zBuf = 0; size_t sz; unsigned mDebug = 0; for(i=1; i