Skip to content

Commit a15a7bc

Browse files
ammaraskargpshead
authored andcommitted
bpo-29505: Fix interpreter in fuzzing targets to be relocatable (GH-13907)
1 parent d407d2a commit a15a7bc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Modules/_xxtestfuzz/fuzzer.c

+8
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ static int _run_fuzz(const uint8_t *data, size_t size, int(*fuzzer)(const char*
8888
/* CPython generates a lot of leak warnings for whatever reason. */
8989
int __lsan_is_turned_off(void) { return 1; }
9090

91+
wchar_t wide_program_name[NAME_MAX];
92+
93+
int LLVMFuzzerInitialize(int *argc, char ***argv) {
94+
wchar_t* wide_program_name = Py_DecodeLocale(*argv[0], NULL);
95+
Py_SetProgramName(wide_program_name);
96+
return 0;
97+
}
98+
9199
/* Fuzz test interface.
92100
This returns the bitwise or of all fuzz test's return values.
93101

0 commit comments

Comments
 (0)