stream: reject overly long URLs

This commit is contained in:
wm4 2015-01-21 12:11:37 +01:00 committed by Diogo Franco (Kovensky)
parent a8b364cad3
commit 141728832b
1 changed files with 4 additions and 0 deletions

View File

@ -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++) {