diff options
author | wm4 <wm4@nowhere> | 2015-01-21 12:11:37 +0100 |
---|---|---|
committer | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2015-01-25 17:00:20 +0900 |
commit | 141728832bc3e3241592318706e1420490e749d9 (patch) | |
tree | 80bbb2657c34810757f1022c7eda9d3b5248fc5f | |
parent | a8b364cad382a13d94794a4adad50552abc14b75 (diff) | |
download | mpv-141728832bc3e3241592318706e1420490e749d9.tar.bz2 mpv-141728832bc3e3241592318706e1420490e749d9.tar.xz |
stream: reject overly long URLs
-rw-r--r-- | stream/stream.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/stream/stream.c b/stream/stream.c index ad3bbb6d33..b0ca33a7d4 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -20,6 +20,7 @@ #include <stdlib.h> #include <sys/types.h> #include <unistd.h> +#include <limits.h> #include <errno.h> #include <strings.h> @@ -348,6 +349,9 @@ struct stream *stream_create(const char *url, int flags, struct stream *s = NULL; assert(url); + if (strlen(url) > INT_MAX / 8) + goto done; + // Open stream proper bool unsafe = false; for (int i = 0; stream_list[i]; i++) { |