Browse Source

fuzz: Fix interfacing with LLVMFuzzer functions (#2068)

master
Samuel Thibault 5 months ago
parent
commit
6dde3b8294
No account linked to committer's email address
3 changed files with 4 additions and 4 deletions
  1. 1
    0
      tests/fuzzing/synth_fuzzer.c
  2. 1
    1
      tests/fuzzrunner.c
  3. 2
    3
      tests/ssml-fuzzer.c

+ 1
- 0
tests/fuzzing/synth_fuzzer.c View File

@@ -42,6 +42,7 @@ espeak_callback(short *data, int samples, espeak_EVENT *events)
/* See http://llvm.org/docs/LibFuzzer.html */
extern int LLVMFuzzerRunDriver(int *argc, char ***argv,
int (*UserCb)(const uint8_t *Data, size_t Size));
extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{

+ 1
- 1
tests/fuzzrunner.c View File

@@ -27,7 +27,7 @@

#include <espeak-ng/espeak_ng.h>

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);

int main(int argc, char **argv) {
int i;

+ 2
- 3
tests/ssml-fuzzer.c View File

@@ -42,14 +42,13 @@ extern int LLVMFuzzerInitialize(const int* argc, char*** argv);

char *filepath = NULL;

extern int LLVMFuzzerInitialize(const int* argc, char*** argv)
{
int LLVMFuzzerInitialize(const int* argc, char*** argv) {
(void)argc; // unused
filepath = dirname(strdup((*argv)[0]));
return 0;
}

extern int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (!initialized) {
const char *hasDataPath = getenv("ESPEAK_DATA_PATH");
if (!hasDataPath) {

Loading…
Cancel
Save