Merge pull request #6056 from DavidKorczynski/develop

Initial fuzzing integration
This commit is contained in:
Shengliang Guan 2021-05-15 22:09:42 +08:00 committed by GitHub
commit af7a668b90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

15
tests/fuzz/sql-fuzzer.c Normal file
View File

@ -0,0 +1,15 @@
#include "qSqlparser.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){
char *new_str = (char *)malloc(size+1);
if (new_str == NULL){
return 0;
}
memcpy(new_str, data, size);
new_str[size] = '\0';
qSqlParse(new_str);
free(new_str);
return 0;
}