From patchwork Fri Apr 19 22:03:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 12822 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 D0C454485A3 for ; Sat, 20 Apr 2019 01:04:23 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B849768A9EF; Sat, 20 Apr 2019 01:04:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B1BB368A441 for ; Sat, 20 Apr 2019 01:04:16 +0300 (EEST) Received: by mail-wm1-f67.google.com with SMTP id y197so7618081wmd.0 for ; Fri, 19 Apr 2019 15:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ee7BTqkoK4kGHZ/jnoE5f2P+jHXjX6MzDfjZmsG04fM=; b=e+EdpXn1qFsIgrezKksRVvUGPwgLUReOWWB25oBbxu1HFj5F82xofXVOyv+gqxl/pY Zz5vraGwjcRoOSPI4uwPJggREgST7uN18sfVZuo2r9vX4Y0RHSkpX51LxHBOmfrnkrFB Ua4UNN/yQr3lH2A7F9icECjiTBSLLVdhQouAqC9t2SceTT2VDVPSU6l/mB0pPvKjJ5t1 k0uTZ8zeu6SnBQkVS9HYvheh+lFH/06pCUysl1yDLKpru2/Et5pQQ1xKk/V/JXk7iNt7 5zGHpZ5jHGS0DN4fO30wxz8P9EVakPB0hFoEQ2DILI5vz0k/M+94ClWpXGu4wFKe7HxZ vhiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ee7BTqkoK4kGHZ/jnoE5f2P+jHXjX6MzDfjZmsG04fM=; b=a0u0KZ3Qwzmoef2wCYo81rJKf0gdcim3GWlfrgUo9X8lLwDthXqagGJB03Bqgbd6NT zawnEt8P0H0eucQZpl1zpuRm7S+cllrSwyhibc/2aLw1MIH+CfjDGDfPF8+MQcy2m3yn c5S3mNpfpwwflHh7RFT1qhtaz+TxsQYQQAHpmHWGCdBAQz0tz7QBPMPIIatEgPRYEYN8 e7czy9B53uVo+NAdAEAudzZGxOpgU4+iQT2hH1vqid/s+LPF3FjUIcH4yDGYD7UrKJDa 6AZSJ2diU92EqkMhWOXIgngDeirCkAaGXpzDFJa7FzscD8tjS0OszLw3lPB9y4bofF+w /msA== X-Gm-Message-State: APjAAAUATD9e1q8r/ZA25Yt1prsoDwhivQqMQ9eYYX5iXmarB060Cn+v mSdZ2zGwRi+GR4MptbFwCMStFfQG3E0= X-Google-Smtp-Source: APXvYqxPmedmDHnV7DDfyoVgjUu3mG0uNOq5pJ1yahD8KAwlII5/nZObhIdTGz1732Dg5PyQnlhZwg== X-Received: by 2002:a1c:a184:: with SMTP id k126mr3916350wme.71.1555711455833; Fri, 19 Apr 2019 15:04:15 -0700 (PDT) Received: from localhost.localdomain (ipbcc08c44.dynamic.kabel-deutschland.de. [188.192.140.68]) by smtp.gmail.com with ESMTPSA id z11sm5650642wmf.12.2019.04.19.15.04.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Apr 2019 15:04:14 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 20 Apr 2019 00:03:14 +0200 Message-Id: <20190419220316.47392-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190413133052.2668-1-andreas.rheinhardt@googlemail.com> References: <20190413133052.2668-1-andreas.rheinhardt@googlemail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] lavf/webm_chunk: Respect buffer size 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The last argument of av_strlcpy is supposed to contain the size of the destination buffer, but it was filled with the size of the source string, effectively negating its very purpose. Signed-off-by: Andreas Rheinhardt --- As the author information in my previous patchset has been munged, I resend this to make the committer's job easier. libavformat/webm_chunk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c index ec1ec4bf91..2c99753b5b 100644 --- a/libavformat/webm_chunk.c +++ b/libavformat/webm_chunk.c @@ -96,7 +96,7 @@ static int get_chunk_filename(AVFormatContext *s, int is_header, char *filename) av_log(oc, AV_LOG_ERROR, "No header filename provided\n"); return AVERROR(EINVAL); } - av_strlcpy(filename, wc->header_filename, strlen(wc->header_filename) + 1); + av_strlcpy(filename, wc->header_filename, MAX_FILENAME_SIZE); } else { if (av_get_frame_filename(filename, MAX_FILENAME_SIZE, s->url, wc->chunk_index - 1) < 0) {