From 141728832bc3e3241592318706e1420490e749d9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 21 Jan 2015 12:11:37 +0100 Subject: stream: reject overly long URLs --- stream/stream.c | 4 ++++ 1 file changed, 4 insertions(+) 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 #include #include +#include #include #include @@ -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++) { -- cgit v1.2.3