From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 2D0283858C1F for ; Tue, 1 Nov 2022 11:18:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2D0283858C1F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667301489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AIP/ymnHO0fh646DPr7QIyrJfxC1O49yprFLOlF97Ko=; b=cOiKXvDmmhuht+nRdIXVjqGkX+p05dCWylp63hRNCsC0PI8bCV++uWgC0i5xtGX9ixP/yp aCwt9T9gN4131GZ/40tMmj1rUT5bCLcVukHf9aUWFK2psfurWrSaDbPoXv7CfAVj/maxvc DYgEialrpQL7TV79CocLQbKm6T045do= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-226-m50bh8JxM-Kv3wdbJ33-Rg-1; Tue, 01 Nov 2022 07:18:09 -0400 X-MC-Unique: m50bh8JxM-Kv3wdbJ33-Rg-1 Received: by mail-qt1-f198.google.com with SMTP id 17-20020ac85711000000b0039ccd4c9a37so9680824qtw.20 for ; Tue, 01 Nov 2022 04:18:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AIP/ymnHO0fh646DPr7QIyrJfxC1O49yprFLOlF97Ko=; b=0HZpe9xITXkiZ5DzUB7M7i1I8/gsPTtAJrgLZ35emNhnMlCNjvYOATpmw5hKdoLSBe tJVPjfrhrGDlS5iJ8xcp0HU5B1447pOorUDWyfhQ+Y4KzOMPb/7L/lZ8xVbsFtuPwT/j ZNsagzz/p3nFB3IrQVjpGA8YtHn8csgK/nezyYfGF1iBMqIhfEEeFiLNElWSyHLjEHNk 4hR2gK5bPhIdlSsaCDdOASq/znb62q2PGlmu/hEupKbuSYkj/DRZ21oZ7wL8cj+3VIoe PSBNd1I14cbR7xZy6jt5xPHweQRWTrgIi1Tdw+knj/CmgmlgadsRjsfsaaV5qH+f3K4M T9Ug== X-Gm-Message-State: ACrzQf1QZXEQ8LxTwCSxpIjC+4NQU9m64ynhGK2H9w9XPWx05dvB9giI +fbsQxm3GI7CJLBzD4FB71dVweB24UL//CFn+qoTQBusCgoxzpeOu+iQZahj9F2YWRkpMjulddq JrW0q2VXHpRbMEME5Ei7rucLyzhY5SIAP4KJ0LMh8wqKOmoMEecvjRZ6rj72OMoTtXM1paw== X-Received: by 2002:a05:622a:11d0:b0:39d:322:7c38 with SMTP id n16-20020a05622a11d000b0039d03227c38mr14318566qtk.291.1667301488453; Tue, 01 Nov 2022 04:18:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6R7xx64DTSJIvcGQ36scWrXeRWJaN4BLgf3wSCjgGmHEeYZyojpMVJ8OBmljCiIus8vUUQtA== X-Received: by 2002:a05:622a:11d0:b0:39d:322:7c38 with SMTP id n16-20020a05622a11d000b0039d03227c38mr14318549qtk.291.1667301488151; Tue, 01 Nov 2022 04:18:08 -0700 (PDT) Received: from localhost ([31.111.84.238]) by smtp.gmail.com with ESMTPSA id j8-20020a05620a410800b006fa313bf185sm3161317qko.8.2022.11.01.04.18.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 04:18:07 -0700 (PDT) From: Andrew Burgess To: binutils@sourceware.org Cc: Andrew Burgess Subject: [PUSHED] opcodes/arm: don't pass non-string literal to printf like function Date: Tue, 1 Nov 2022 11:18:02 +0000 Message-Id: <20221101111802.1532080-1-aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20221101105724.1527333-1-aburgess@redhat.com> References: <20221101105724.1527333-1-aburgess@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: To my great shame. After fixing the previous issue, yet another problem showed up on a couple of the buildbots (but not all, I'm guessing due to compiler version differences). Again, I've pushed the fix for this issue. I don't think there will be any disagreement for this fix, but do let me know if there is and I'm happy to provide an adjustment. Once again, sorry for the breakage, Andrew --- The earlier commit: commit 6576bffe6cbbb53c5756b2fccd2593ba69b74cdf Date: Thu Jul 7 13:43:45 2022 +0100 opcodes/arm: add disassembler styling for arm introduced two places where a register name was passed as the format string to the disassembler's fprintf_styled_func callback. This will cause a warning from some compilers, like this: ../../binutils-gdb/opcodes/arm-dis.c: In function ‘print_mve_vld_str_addr’: ../../binutils-gdb/opcodes/arm-dis.c:6005:3: error: format not a string literal and no format arguments [-Werror=format-security] 6005 | func (stream, dis_style_register, arm_regnames[gpr]); | ^~~~ This commit fixes these by using "%s" as the format string. --- opcodes/arm-dis.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c index 101b3f84dfe..31ed81f5a4e 100644 --- a/opcodes/arm-dis.c +++ b/opcodes/arm-dis.c @@ -6002,7 +6002,7 @@ print_mve_vld_str_addr (struct disassemble_info *info, add_sub = "-"; func (stream, dis_style_text, "["); - func (stream, dis_style_register, arm_regnames[gpr]); + func (stream, dis_style_register, "%s", arm_regnames[gpr]); if (p == 1) { func (stream, dis_style_text, ", "); @@ -8588,7 +8588,8 @@ print_insn_coprocessor_1 (const struct sopcode32 *opcodes, is_unpredictable = true; u_reg = value; } - func (stream, dis_style_register, arm_regnames[value]); + func (stream, dis_style_register, "%s", + arm_regnames[value]); break; case 'V': if (given & (1 << 6)) -- 2.25.4