x86/disasm: Do not use format string without format specifiers
The x86 disassembler is updated to avoid using format strings without format specifiers, fixing a build failure with -Werror=format-security.
This patch modifies the x86 disassembler to avoid using format strings without format specifiers in calls to i386_dis_printf. This resolves a build failure encountered when compiling with the -Werror=format-security flag. The issue was identified as PR binutils/34168.
- proposer
Proposes a patch to fix a build failure due to using format strings without format specifiers.
In Details
This patch modifies opcodes/i386-dis.c to address a format string vulnerability. The disassembler uses i386_dis_printf to print output, and the patch ensures that format strings are always accompanied by the appropriate format specifiers. This resolves a build error triggered by -Werror=format-security.
For Context
A disassembler translates machine code into human-readable assembly language. Format string vulnerabilities occur when a program uses user-controlled input as a format string in functions like printf. This patch fixes such a vulnerability in the x86 disassembler by ensuring that all format strings are properly specified, thereby preventing potential security issues and build failures.