1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Support Launch when BindAddress is not INADDR_ANY or localhost. Also fix a possible buffer overflow

Originally committed as revision 4692 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Alex Beregszaszi 2005-11-13 01:41:01 +00:00
parent 97246091a5
commit 4b4f38e42e

View File

@ -3868,8 +3868,11 @@ static int parse_ffconfig(const char *filename)
feed->child_argv[i] = av_malloc(30 + strlen(feed->filename));
snprintf(feed->child_argv[i], 256, "http://127.0.0.1:%d/%s",
ntohs(my_http_addr.sin_port), feed->filename);
snprintf(feed->child_argv[i], 30+strlen(feed->filename),
"http://%s:%d/%s",
(my_http_addr.sin_addr.s_addr == INADDR_ANY) ? "127.0.0.1" :
inet_ntoa(my_http_addr.sin_addr),
ntohs(my_http_addr.sin_port), feed->filename);
}
} else if (!strcasecmp(cmd, "ReadOnlyFile")) {
if (feed) {