From patchwork Fri Jan 18 08:46:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodger Combs X-Patchwork-Id: 11791 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 745D344E019 for ; Fri, 18 Jan 2019 10:46:22 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9E93468AC79; Fri, 18 Jan 2019 10:46:10 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it1-f182.google.com (mail-it1-f182.google.com [209.85.166.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2E92A68AC61 for ; Fri, 18 Jan 2019 10:46:04 +0200 (EET) Received: by mail-it1-f182.google.com with SMTP id x124so500326itd.1 for ; Fri, 18 Jan 2019 00:46:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=jHrQlycJLEM1iTvAkb0CfPDU3Nq7gbqDcYs8Ks1cGfw=; b=EyHBh3n/iwqXePBm1ozRmC0/L3MOvapoMuBchlTOcOxs/t+Ampu9pE3xXo5JAVtQf3 LuqY46PDyAaD/UG6D1/VESxDtM2B6KsiwyCL+g/R3r1NLwhUtwruBK+n+bIzXsxMXit0 HwziUC4bVU2ugN/gSqX7U65Ym2KnQOq3MBC6q7gtuXcTsXfaMHKHkD1UlIP0r+a8+uVC eegaT5nTvPZEp71xkBQrMjZD2Csq7oLrWpux2PymcJCkcqD5xcMe80A4Rys561Asipn9 uOj+v4mUCRUcXUQ5nnFuKKKuGeyExwVWVIwDcdsRV0lsti7u0LWnNpmW6xzn7QEKX1w5 Mfgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jHrQlycJLEM1iTvAkb0CfPDU3Nq7gbqDcYs8Ks1cGfw=; b=f5XavJFdr5g5/oKqNV9CUqpM0P85aFHE8Ns3hOz2EakvuAK+H+j3iWW1OheIYI302J J/PH+Y+GJhlBXDgCWolAcX0J1meJHGKqyGg86pXjnKkJZfyqXslcS2E3uCmKePczr74m 0tdZkO3opFJeyy9Jo5lljMJBoAMQ9Ybs5y+BOyR2dFgH9V1N6IpPyroZOwkmovyQC8mc pFubrjsfFOV8JbYzdg0fNFCI7Tv1KDTqbCLo5rqzWB8IiCkkCKW9O+bDnqGgzLa6RfBp TTExmH1g+LgmlQVf8TzniJl5Ndjnn0+xyD9qS/18Q73KeZJkrROufWgp8gS9NJy7g093 VSQQ== X-Gm-Message-State: AJcUukcIz1GRnr6FXIrWnvWGoU7yWg2yyvV585bQsBvEmKWKa1LgfFec nZ6ZqRW9AzUDhN1axHMZuephfFY7 X-Google-Smtp-Source: ALg8bN5OJP6HjlNJYHGGxS3BIX9R6GjCtUGdQ2aKr6T/RVnRozWYnDci/+CCKPBe22PoyT+jK1ueFw== X-Received: by 2002:a02:77c1:: with SMTP id g184mr9303745jac.140.1547801178175; Fri, 18 Jan 2019 00:46:18 -0800 (PST) Received: from Rodgers-MBP.localdomain ([71.201.155.37]) by smtp.gmail.com with ESMTPSA id b25sm1477777iot.10.2019.01.18.00.46.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Jan 2019 00:46:17 -0800 (PST) From: Rodger Combs To: ffmpeg-devel@ffmpeg.org Date: Fri, 18 Jan 2019 02:46:03 -0600 Message-Id: <20190118084604.82324-4-rodger.combs@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190118084604.82324-1-rodger.combs@gmail.com> References: <20190118084604.82324-1-rodger.combs@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/5] lavf/tls: apply numerichost check to verifyhost X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- 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);