mirror of
https://github.com/mpv-player/mpv
synced 2024-12-28 10:02:17 +00:00
stream: reject overly long URLs
This commit is contained in:
parent
d558accaa6
commit
303924c343
@ -20,6 +20,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
@ -348,6 +349,9 @@ struct stream *stream_create(const char *url, int flags,
|
|||||||
struct stream *s = NULL;
|
struct stream *s = NULL;
|
||||||
assert(url);
|
assert(url);
|
||||||
|
|
||||||
|
if (strlen(url) > INT_MAX / 8)
|
||||||
|
goto done;
|
||||||
|
|
||||||
// Open stream proper
|
// Open stream proper
|
||||||
bool unsafe = false;
|
bool unsafe = false;
|
||||||
for (int i = 0; stream_list[i]; i++) {
|
for (int i = 0; stream_list[i]; i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user