From patchwork Wed Jun 9 20:01:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 28190 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5e:c91a:0:0:0:0:0 with SMTP id z26csp1152312iol; Wed, 9 Jun 2021 13:01:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtUBa0PEY02YLn+olHuV2A/9s3Xei2g2AW+TMVAoS8OvXa/GNc2MG3FUkVg9/a+AL9+rbk X-Received: by 2002:aa7:c799:: with SMTP id n25mr1071487eds.16.1623268892813; Wed, 09 Jun 2021 13:01:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623268892; cv=none; d=google.com; s=arc-20160816; b=cdb14bdhb4JfHO0NKWr98XUx8V3Xi4pydmhmDvpWDpB+625G1Rx55L/oG8walMv+Er uz92DfqcssaHQkc4VPnoYE6sqhWxDRabKqsggKcU4uUZDkTr02n8pGeiN9qjQNyV+Yty YXT0CZE91aN9+RaWV2swSKcXLxCtbdb+1mlEAbHUs29idOcYk4yJmDVxm+H2h7zjXyqY 6fMM95ht+UxVE1oFn9Snhh0cxeW1Cax7ZKAQwXsiWop22lNEPgtGtypGyU0ITH0vSWpa BfkGyr18cSmPUkRwS4N74tAuDeM/KyRY5TsypBmYDWzGhcvqCYkZxOCvAbJOfa468U/Y 0v8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=uSka7Iq4K7iq8bdHWi6G4+1l241i49WJoWiHrax0ITc=; b=fgjaKBG2FYPy13WeMs4GZd9wZhshgB7XutVWcjM8Uw0IxjXUnQdOTiDYE0VHzoLf1E URdfSRscflH/EXeem7Dk9DYV1PNTihZy3M1mtMkiOFQG6ijhWa93zF2JTpJFGy0W786o d17ks/vt8YfJb2yIUvh34ZKvoYNWi/JXuYyPVKtPtNAsEWITFDLXYiVUTYgFy8IJRHwa okWdljd1Zhb99NZstWpxX7mIcXpYT/lhIsaivTCtvextvpQqD9f70lZ5azKysiChnHWh DrlihAy++N7eCUUWD2R4VZxnqwwSXZdpKDzQhxKy5KbECvPSzKAxa2FvR2mMcC2jzO49 D6uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Dt2nlIv8; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id q5si595278ejy.439.2021.06.09.13.01.32; Wed, 09 Jun 2021 13:01:32 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Dt2nlIv8; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 70468687FED; Wed, 9 Jun 2021 23:01:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 71391680A0F for ; Wed, 9 Jun 2021 23:01:22 +0300 (EEST) Received: by mail-qk1-f181.google.com with SMTP id j62so11192539qke.10 for ; Wed, 09 Jun 2021 13:01:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=wshdW8km0cA9r10OmkRx3/t0vqVn2Lk172lEzTJ7Ri0=; b=Dt2nlIv8JflOC3ysS5fCs/B73NR1BeMInepfuHaLeSk975K++/G7QQkxqfT2uVMRQB uO0shntAEn97hu4/bMbDW2ocdnd/SorPmOABO+YDGGThWd69tR29FBjTC0mL+4M7v3oI elfn6myYObLXJSTHHOv8RExLJ5b7iFwZj13khfHmqO9uibnCWGeFUu7/GqQJg23Eiu3l CB+LC1xYlSp49j1pv69agfbHzUTbq4nuNOrE2IKtMVPt9CAgxh423D3ztI8M0xABB73f g//y7V5HcJFptxPCOvcxs+3BTSjTQnAXgdzjK2bLUW8X9dDkrVwdosR1SZM6zsdoAK1Z 6VUg== 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:mime-version :content-transfer-encoding; bh=wshdW8km0cA9r10OmkRx3/t0vqVn2Lk172lEzTJ7Ri0=; b=hHpF4sTkFn1SwWDy33+M/JabzV0QNBf6xRCKDT/Z04UH1mTpC2In1w8LsLca06XUB/ cgkYykwtj3QD7ZKxc3xnESitfvCPxPmT8Gce1XpLuCfiprYOBoySZRr/Z01vHNMrc8KX s7o3aZXlhoHvl4my2bjVDaaf6XjIlZFJwHhcyHyGBtY3wgi9tfRpFWURhA0hv90MaRFA cn6TYMAWYCdSCidADJd5V7md246kyUZNuE5yNh4IcPOBD7o8G07Ky162AVPvPMDj9s8v XTIQLeR5i38IryBuJJpeS7U+DworXEUrxMpGGmi5ADo2QXSODmKyPGfmK+KIwIH+Nliq ys9g== X-Gm-Message-State: AOAM531Ivd78AFUIiBS61J5mA10JJ3iwCALyNSnc8EcuELVrHQ35Jmye zT4FyTilNMk53TAZCKkrO5zKfSFKKajHyQ== X-Received: by 2002:ae9:f309:: with SMTP id p9mr1330664qkg.363.1623268880788; Wed, 09 Jun 2021 13:01:20 -0700 (PDT) Received: from localhost.localdomain ([191.84.230.84]) by smtp.gmail.com with ESMTPSA id d24sm776347qtm.70.2021.06.09.13.01.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 13:01:20 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 9 Jun 2021 17:01:02 -0300 Message-Id: <20210609200102.4900-1-jamrial@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/http: prevent truncation of sanitized_path X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: 7wdiWuO3vJpM path1 and sanitized_path are both MAX_URL_SIZE bytes long, yet the latter is copied from the former with the addition of one extra character. Should fix a -Wformat-truncation warning. Signed-off-by: James Almer --- libavformat/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/http.c b/libavformat/http.c index 1fc95c768c..1e7d97a027 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -192,7 +192,7 @@ static int http_open_cnx_internal(URLContext *h, AVDictionary **options) char *hashmark; char hostname[1024], hoststr[1024], proto[10]; char auth[1024], proxyauth[1024] = ""; - char path1[MAX_URL_SIZE], sanitized_path[MAX_URL_SIZE]; + char path1[MAX_URL_SIZE], sanitized_path[MAX_URL_SIZE + 1]; char buf[1024], urlbuf[MAX_URL_SIZE]; int port, use_proxy, err, location_changed = 0; HTTPContext *s = h->priv_data;