demux_mf: don't run glob() on urls

Not intended to be run on urls. Fixes stack-overflow in glob() when
unexpected data is passed.

Found by OSS-Fuzz.
This commit is contained in:
Kacper Michajłow 2024-07-12 13:05:48 +02:00
parent c2fc6503fb
commit 024c79a53c
1 changed files with 5 additions and 1 deletions

View File

@ -119,7 +119,11 @@ static mf_t *open_mf_pattern(void *talloc_ctx, struct demuxer *d, char *filename
goto exit_mf;
}
size_t fname_avail = strlen(filename) + 32;
bstr bfilename = bstr0(filename);
if (mp_is_url(bfilename))
goto exit_mf;
size_t fname_avail = bfilename.len + 32;
char *fname = talloc_size(mf, fname_avail);
#if HAVE_GLOB