mirror of https://github.com/mpv-player/mpv
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:
parent
b4123826e5
commit
c3de4f04db
|
@ -28,6 +28,11 @@
|
||||||
|
|
||||||
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
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.
|
// fmemopen doesn't have associated file descriptor, so we do copy.
|
||||||
int fd = memfd_create("fuzz_mpv_load", 0);
|
int fd = memfd_create("fuzz_mpv_load", 0);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
|
|
Loading…
Reference in New Issue