aboutsummaryrefslogtreecommitdiffstats
path: root/ffserver.c
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2007-04-22 18:06:08 +0000
committerAlex Beregszaszi <alex@rtfs.hu>2007-04-22 18:06:08 +0000
commitaabce53304eae73c852a9292ed6e532b8ae02b3f (patch)
tree1b0120dbe7b19c0efe27a5c456cb83adfe9c9711 /ffserver.c
parent5eb782f080a9da3b4229f5fc6de9c08e8d504e9d (diff)
downloadffmpeg-aabce53304eae73c852a9292ed6e532b8ae02b3f.tar.gz
check ip port range from config
Originally committed as revision 8787 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffserver.c')
-rw-r--r--ffserver.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/ffserver.c b/ffserver.c
index b977830618..71ef5bfdb5 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -3813,7 +3813,13 @@ static int parse_ffconfig(const char *filename)
if (!strcasecmp(cmd, "Port")) {
get_arg(arg, sizeof(arg), &p);
- my_http_addr.sin_port = htons (atoi(arg));
+ val = atoi(arg);
+ if (val < 1 || val > 65536) {
+ fprintf(stderr, "%s:%d: Invalid port: %s\n",
+ filename, line_num, arg);
+ errors++;
+ }
+ my_http_addr.sin_port = htons(val);
} else if (!strcasecmp(cmd, "BindAddress")) {
get_arg(arg, sizeof(arg), &p);
if (!inet_aton(arg, &my_http_addr.sin_addr)) {
@@ -3825,7 +3831,13 @@ static int parse_ffconfig(const char *filename)
ffserver_daemon = 0;
} else if (!strcasecmp(cmd, "RTSPPort")) {
get_arg(arg, sizeof(arg), &p);
- my_rtsp_addr.sin_port = htons (atoi(arg));
+ val = atoi(arg);
+ if (val < 1 || val > 65536) {
+ fprintf(stderr, "%s:%d: Invalid port: %s\n",
+ filename, line_num, arg);
+ errors++;
+ }
+ my_rtsp_addr.sin_port = htons(atoi(arg));
} else if (!strcasecmp(cmd, "RTSPBindAddress")) {
get_arg(arg, sizeof(arg), &p);
if (!inet_aton(arg, &my_rtsp_addr.sin_addr)) {