fuzzer_load: disallow include option in config files

It produces undeterministic results, especially if it do
`include=fd://N` which starts loading external data.
This commit is contained in:
Kacper Michajłow committed 2024-06-23 02:33:04 +02:00
1 parent b4123826e5
commit c3de4f04db
1 file changed
+5
+5
View File
@@ -28,6 +28,11 @@
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
#if defined(MPV_LOAD_CONFIG_FILE) || defined(MPV_LOAD_INPUT_CONF)
if (memmem(data, size, "include", sizeof("include") - 1))
return 0;
#endif
// fmemopen doesn't have associated file descriptor, so we do copy.
int fd = memfd_create("fuzz_mpv_load", 0);
if (fd == -1)