From patchwork Thu Jun 9 22:16:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Wendling X-Patchwork-Id: 12876506 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 87A76C433EF for ; Fri, 10 Jun 2022 06:41:20 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CA1711F81; Fri, 10 Jun 2022 08:40:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CA1711F81 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654843278; bh=gEdmg7UT13r2FJiEnPr67MFCzYOvV0JNu5LQhrIdOMs=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=KA27qmPHb3SBpTN3OcLKfRABOKy0eZDaGLagEAQLBpWYnBzzq9tFlWfFJodjP0pQE LW2zAC7TccMG9xPc/QxOWg28yzLiKAI4+5MgyEArVrBJ5lzPMA5p3SvlNbyI8jBWYG KMeAHjn5uvpQ2G4tTdqjhRYqIx2/qlV7pIjozP+o= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B9A7EF80558; Fri, 10 Jun 2022 08:37:48 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 63BD8F800C7; Fri, 10 Jun 2022 00:20:30 +0200 (CEST) Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E20DAF800C7 for ; Fri, 10 Jun 2022 00:20:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E20DAF800C7 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="NA8rGIzS" Received: by mail-pg1-x549.google.com with SMTP id y63-20020a638a42000000b003fd47b6f280so8515170pgd.12 for ; Thu, 09 Jun 2022 15:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=dB/VRnBqrla/uo3hQxagOMwn8rw3rKKNrg8KvvIMmrs=; b=NA8rGIzS2Lo/FSyJFJSopJzo3vj2qG+W/JBu2Td+wh8lNm3aGHNFbCPALJTDiKY3VZ BXYoT+Ww8rgiNjDcWDo8JWEIvIa789ch4uJ/akkx61GHrCbS4UYTLU+WBzXi0U6zqFg6 WETSd0zF9UD0yrUhECgMgO4+3B7vaNDE5q4OxsAILit4vZz26MEF5lP7eGpObNUfQYZP qWyriCnElNMS5dBnlp4ECfJw4cwUWsda0JPVGIsCkMRh996FjTM9tl6X5Bjcl49Ex3bX 056kN/4A+KMGFsvjat6Zhxnibo6NVJe0KQfbbqHffKzcdpAaOGAQ/5H1gcLRSIgsdnQd eZOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=dB/VRnBqrla/uo3hQxagOMwn8rw3rKKNrg8KvvIMmrs=; b=vbugsQRohqZOGhXkTMDRMsd/A1ztIBR/Fq5Eqd/oVJ7Vz2HJ/SXPAOyy7npghI8s2Q NRIzYr1MI2fD1P9hcu98/J1Rpzih1vq0AyoV9ug8bG3sMFebdqzdvHbaHraGTYvfWfkF triTDbunKT4lwpwJJeulWCC7HPmbPeh2imMVEov2EozjAuKMx2M+cXAYA/CPyM5Qc+PR OxwBqorNLmwNTWUdy7v06uQPW41KG4bNkX78DOn9G8oYPoUEwaXCuL1jbSpSnca74c2P wDMT+yihrF9D9/1JQekVwyW6nYJNn/noztrpqmkfB6A7DhHcaXnWAgrgPKKASRlze01E zcxg== X-Gm-Message-State: AOAM5318rX7HhIBOHEzbKMzLcEXmfy7eWwNEYpJXKO9D4VeNTMJbIJ25 YeY9Hgj+PCR6N0OYfH4T5ultC0Lo X-Google-Smtp-Source: ABdhPJye2mFQrzIepKAqLUDnC7IYTgWuIi+7I2qa8DRzQUgLX+2gR0oj+bp3uxnl8nOmUO9s5APs/msqoQ== X-Received: from fawn.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5795]) (user=morbo job=sendgmr) by 2002:a62:e919:0:b0:51e:7b6e:5a3b with SMTP id j25-20020a62e919000000b0051e7b6e5a3bmr1529888pfh.78.1654813218119; Thu, 09 Jun 2022 15:20:18 -0700 (PDT) Date: Thu, 9 Jun 2022 22:16:27 +0000 In-Reply-To: <20220609221702.347522-1-morbo@google.com> Message-Id: <20220609221702.347522-9-morbo@google.com> Mime-Version: 1.0 References: <20220609221702.347522-1-morbo@google.com> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog Subject: [PATCH 08/12] cdrom: use correct format characters From: Bill Wendling To: isanbard@gmail.com X-Mailman-Approved-At: Fri, 10 Jun 2022 08:37:37 +0200 Cc: alsa-devel@alsa-project.org, x86@kernel.org, Nick Desaulniers , Dave Hansen , Phillip Potter , linux-mm@kvack.org, Eric Dumazet , netdev@vger.kernel.org, "H. Peter Anvin" , Daniel Kiper , "Rafael J. Wysocki" , Jozsef Kadlecsik , linux-acpi@vger.kernel.org, Ingo Molnar , Tom Rix , Jakub Kicinski , Paolo Abeni , Pablo Neira Ayuso , llvm@lists.linux.dev, coreteam@netfilter.org, Arnd Bergmann , Ross Philipson , Nathan Chancellor , Borislav Petkov , Thomas Gleixner , linux-edac@vger.kernel.org, Tony Luck , Greg Kroah-Hartman , Florian Westphal , Takashi Iwai , linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org, Jan Kara , Andrew Morton , "David S. Miller" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Bill Wendling When compiling with -Wformat, clang emits the following warnings: drivers/cdrom/cdrom.c:3454:48: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] ret = scnprintf(info + *pos, max_size - *pos, header); ^~~~~~ Use a string literal for the format string. Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Bill Wendling --- drivers/cdrom/cdrom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 416f723a2dbb..52b40120c76e 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -3451,7 +3451,7 @@ static int cdrom_print_info(const char *header, int val, char *info, struct cdrom_device_info *cdi; int ret; - ret = scnprintf(info + *pos, max_size - *pos, header); + ret = scnprintf(info + *pos, max_size - *pos, "%s", header); if (!ret) return 1;