mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-08-13 17:07:21 +00:00
avformat/http: Check white and blacklists on redirects
Noticed while fixing the previous Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Timo Rothenpieler
parent
b9227d49ea
commit
23c8123d5b
@@ -242,6 +242,16 @@ static int http_open_cnx_internal(URLContext *h, AVDictionary **options)
|
||||
proxy_path && av_strstart(proxy_path, "http://", NULL);
|
||||
freeenv_utf8(env_no_proxy);
|
||||
|
||||
if (h->protocol_whitelist && av_match_list(proto, h->protocol_whitelist, ',') <= 0) {
|
||||
av_log(h, AV_LOG_ERROR, "Protocol '%s' not on whitelist '%s'!\n", proto, h->protocol_whitelist);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
if (h->protocol_blacklist && av_match_list(proto, h->protocol_blacklist, ',') > 0) {
|
||||
av_log(h, AV_LOG_ERROR, "Protocol '%s' on blacklist '%s'!\n", proto, h->protocol_blacklist);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
if (!strcmp(proto, "https")) {
|
||||
lower_proto = "tls";
|
||||
use_proxy = 0;
|
||||
|
||||
Reference in New Issue
Block a user