Skip to content

Commit

Permalink
bpo-29505: Fix interpreter in fuzzing targets to be relocatable (GH-1…
Browse files Browse the repository at this point in the history
…3907)

(cherry picked from commit a15a7bc)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
  • Loading branch information
miss-islington and ammaraskar committed Jun 8, 2019
1 parent c5daae4 commit 22b69da
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Modules/_xxtestfuzz/fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ static int _run_fuzz(const uint8_t *data, size_t size, int(*fuzzer)(const char*
/* CPython generates a lot of leak warnings for whatever reason. */
int __lsan_is_turned_off(void) { return 1; }

wchar_t wide_program_name[NAME_MAX];

int LLVMFuzzerInitialize(int *argc, char ***argv) {
wchar_t* wide_program_name = Py_DecodeLocale(*argv[0], NULL);
Py_SetProgramName(wide_program_name);
return 0;
}

/* Fuzz test interface.
This returns the bitwise or of all fuzz test's return values.
Expand Down

0 comments on commit 22b69da

Please sign in to comment.