History

fuzzer_load: disallow include option in config files

It produces undeterministic results, especially if it do `include=fd://N` which starts loading external data.

Kacper Michajłow committed 2 years ago

Commit c3de4f01 parent b4123821 file · +5 −0Browse files

Unified · Split

fuzzers/fuzzer_load.c+5−0
@@ -28,6 +28,11 @@ · 27 unmodified lines
28 28
29int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)29int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
30{30{
31#if defined(MPV_LOAD_CONFIG_FILE) || defined(MPV_LOAD_INPUT_CONF)
32 if (memmem(data, size, "include", sizeof("include") - 1))
33 return 0;
34#endif
35
31 // fmemopen doesn't have associated file descriptor, so we do copy.36 // fmemopen doesn't have associated file descriptor, so we do copy.
32 int fd = memfd_create("fuzz_mpv_load", 0);37 int fd = memfd_create("fuzz_mpv_load", 0);
33 if (fd == -1)38 if (fd == -1)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t