History

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.

Kacper Michajłow committed 2 years ago

Commit 024c79a1 parent c2fc6501 file · +5 −1Browse files

Unified · Split

demux/demux_mf.c+5−1
@@ -119,7 +119,11 @@ static mf_t *open_mf_pattern(void *talloc_ctx, struct demuxer *d, char *filename · 118 unmodified lines
119119 goto exit_mf;
120120 }
121121
122− size_t fname_avail = strlen(filename) + 32;
122+ bstr bfilename = bstr0(filename);
123+ if (mp_is_url(bfilename))
124+ goto exit_mf;
125+
126+ size_t fname_avail = bfilename.len + 32;
123127 char *fname = talloc_size(mf, fname_avail);
124128
125129 #if HAVE_GLOB

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