Skip to content

Commit d9a595c

Browse files
jpoimboeIngo Molnar
authored andcommitted
objtool: Fix NULL printf() '%s' argument in builtin-check.c:save_argv()
It's probably not the best idea to pass a string pointer to printf() right after confirming said pointer is NULL. Fix the typo and use argv[i] instead. Fixes: c5995ab ("objtool: Improve error handling") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Tested-by: Stephen Rothwell <sfr@canb.auug.org.au> Link: https://lore.kernel.org/r/a814ed8b08fb410be29498a20a5fbbb26e907ecf.1742952512.git.jpoimboe@kernel.org Closes: https://lore.kernel.org/20250326103854.309e3c60@canb.auug.org.au
1 parent 05026ea commit d9a595c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/objtool/builtin-check.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static void save_argv(int argc, const char **argv)
238238
for (int i = 0; i < argc; i++) {
239239
orig_argv[i] = strdup(argv[i]);
240240
if (!orig_argv[i]) {
241-
WARN_GLIBC("strdup(%s)", orig_argv[i]);
241+
WARN_GLIBC("strdup(%s)", argv[i]);
242242
exit(1);
243243
}
244244
};

0 commit comments

Comments
 (0)