From patchwork Tue Sep 8 21:18:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22175 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 E850F44BD83 for ; Wed, 9 Sep 2020 00:19:12 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C433768B63A; Wed, 9 Sep 2020 00:19:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DD1C468B603 for ; Wed, 9 Sep 2020 00:19:05 +0300 (EEST) Received: by mail-wr1-f66.google.com with SMTP id m6so718008wrn.0 for ; Tue, 08 Sep 2020 14:19:05 -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:mime-version :content-transfer-encoding; bh=sDfk3q/KfnfxHRNn216orGJBhybZ5AdpUznD/R8XbXY=; b=FV0QEwtxkIgkd0vcLhZDJf0mf7dNvdkNScHg5dB1oQHZASEpRtmIR9s26ytQawidX0 fXMNXoPiHiLZNqCsYU2AwhJexuYR//molhVQDCcHgU5R75dB7Z/9l74xi2W/uRKNiFft QYvAod7b8p11ruZhUSTF/ZbJlFLr1DMDyWdwmGtGbcaogMSHy3POlMuropr+tzLpTHjl fvVNlfgwA0GuUZfGuBcd8D2CFsJq0/yHMawhfjyC07346/zctqwHAIc0o39peigNKDZl Sls7Cn3ycnICdcsHa440oxhAwmNWgpo9yO/ebdCJPnsVwi3D/JDYdAkCvvF0ntd/xC/+ ZpnA== 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:mime-version :content-transfer-encoding; bh=sDfk3q/KfnfxHRNn216orGJBhybZ5AdpUznD/R8XbXY=; b=O0GRm5DP4raqDvheHHg+VPdLLHKnf3rifa+VWs2Iy9BYgmDZNI00fUQbwkI+dEDonD a5ce7AlAWOzoezeh/X3rHQxifPttH2Py1nx59RRGba7/uAOQSrh7HvJyxjOanvA6vZzJ PePTjqE8NQ1/V4DCtPzPdwuhC32EFknX7rb0WxJmcMp6Iz7mVcvXAP2FB/52aWRR2E1o QfV8aGoW611A8oqgEFS8JsdKBSwHPgMV/8pCPJ2ROryacfJ5a2Bng+BlHqRl80+qfwtt 1kHjQxOPHy4kt3oDJFsL6l+aWqAcpjIJ7SjWlxDZ4x4YqMWOddsws60dXi4U58eJiOeQ T6AA== X-Gm-Message-State: AOAM532B8uA/DLaUH85s3sBwcw/LL668NTGpHRnwnyBTTJXkagUvXtdg z0RMmx29xdhXoxYYPtiC7dlBHK+qqVQ= X-Google-Smtp-Source: ABdhPJxoAQLvKo+Loz10Ti6yfBgPuExd1ppk7JmgQK9iGlTn8C9ICJ5YnPaYVVicJc91atmgE18ELg== X-Received: by 2002:adf:f843:: with SMTP id d3mr598805wrq.226.1599599945022; Tue, 08 Sep 2020 14:19:05 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1fb0f.dynamic.kabel-deutschland.de. [188.193.251.15]) by smtp.gmail.com with ESMTPSA id a15sm1074304wrn.3.2020.09.08.14.19.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 14:19:04 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Sep 2020 23:18:32 +0200 Message-Id: <20200908211856.16290-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 01/25] avfilter/af_headphone: Don't use uninitialized buffer in log message 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" This buffer was supposed to be initialized by sscanf(input, "%7[A-Z]%n", buf, &len), yet if the first input character is not in the A-Z range, buf is not touched (in particular it needn't be zero-terminated if the failure happened when parsing the first channel and it still contains the last channel name if the failure happened when one channel name could be successfully parsed). This is treated as error in which case buf is used directly in the log message. This commit fixes this by actually using the string that could not be matched in the log message instead. Signed-off-by: Andreas Rheinhardt --- libavfilter/af_headphone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/af_headphone.c b/libavfilter/af_headphone.c index 58d82ac41d..e590d02eff 100644 --- a/libavfilter/af_headphone.c +++ b/libavfilter/af_headphone.c @@ -135,7 +135,7 @@ static void parse_map(AVFilterContext *ctx) p = NULL; if (parse_channel_name(s, s->nb_irs, &arg, &out_ch_id, buf)) { - av_log(ctx, AV_LOG_WARNING, "Failed to parse \'%s\' as channel name.\n", buf); + av_log(ctx, AV_LOG_WARNING, "Failed to parse \'%s\' as channel name.\n", arg); continue; } s->mapping[s->nb_irs] = out_ch_id;