[FFmpeg-devel] [PATCH 4/5] lavf/tls: apply numerichost check to verifyhost

Rodger Combs rodger.combs at gmail.com
Fri Jan 18 10:46:03 EET 2019


---
 libavformat/tls.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/tls.c b/libavformat/tls.c
index 10e0792e29..a6dcd3cc96 100644
--- a/libavformat/tls.c
+++ b/libavformat/tls.c
@@ -80,15 +80,15 @@ int ff_tls_open_underlying(TLSShared *c, URLContext *parent, const char *uri, AV
 
     ff_url_join(buf, sizeof(buf), "tcp", NULL, c->underlying_host, port, "%s", p);
 
+    if (!c->host && !(c->host = av_strdup(c->underlying_host)))
+        return AVERROR(ENOMEM);
+
     hints.ai_flags = AI_NUMERICHOST;
-    if (!getaddrinfo(c->underlying_host, NULL, &hints, &ai)) {
+    if (!getaddrinfo(c->host, NULL, &hints, &ai)) {
         c->numerichost = 1;
         freeaddrinfo(ai);
     }
 
-    if (!c->host && !(c->host = av_strdup(c->underlying_host)))
-        return AVERROR(ENOMEM);
-
     proxy_path = getenv("http_proxy");
     use_proxy = !ff_http_match_no_proxy(getenv("no_proxy"), c->underlying_host) &&
                 proxy_path && av_strstart(proxy_path, "http://", NULL);
-- 
2.19.1



More information about the ffmpeg-devel mailing list