[PATCH v3] x86/disasm: do not use format string without format specifiers

Will Hawkins hawkinsw@obs.cr
Sun May 24 04:08:24 GMT 2026


Fixes PR binutils/34168: build failure with -Werror=format-security.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34168

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
---
 v3: Rebase and reword commit message
 v2: Update commit message to reference Bugzilla
 opcodes/i386-dis.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 3c5f173648a..db1e4f7a7d5 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -10375,7 +10375,7 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax)
   for (i = 0; i < MAX_OPERANDS; i++)
     if (ins.op_index[i] != -1 && ins.op_riprel[i])
       {
-	i386_dis_printf (info, dis_style_comment_start, sep);
+	i386_dis_printf (info, dis_style_comment_start, "%s", sep);
 	sep = ", ";
 	(*info->print_address_func)
 	  ((bfd_vma)(ins.start_pc + (ins.codep - ins.start_codep)
@@ -10384,7 +10384,7 @@ print_insn (bfd_vma pc, disassemble_info *info, int intel_syntax)
       }
     else if (*ins.cm_out[i])
       {
-	i386_dis_printf (info, dis_style_comment_start, sep);
+	i386_dis_printf (info, dis_style_comment_start, "%s", sep);
 	sep = ", ";
 	i386_dis_printf (info, dis_style_symbol, "%s", ins.cm_out[i]);
       }
-- 
2.49.0



More information about the Binutils mailing list