mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] objtool: Fix NULL printf() '%s' argument
@ 2025-03-26  1:30 Josh Poimboeuf
  2025-03-26  4:10 ` Stephen Rothwell
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Josh Poimboeuf @ 2025-03-26  1:30 UTC (permalink / raw)
  To: x86
  Cc: linux-kernel, Ingo Molnar, Peter Zijlstra, H. Peter Anvin,
	Stephen Rothwell

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: c5995abe1547 ("objtool: Improve error handling")
Closes: https://lore.kernel.org/20250326103854.309e3c60@canb.auug.org.au
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
 tools/objtool/builtin-check.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c
index 2bdff910430e..e364ab6345d3 100644
--- a/tools/objtool/builtin-check.c
+++ b/tools/objtool/builtin-check.c
@@ -238,7 +238,7 @@ static void save_argv(int argc, const char **argv)
 	for (int i = 0; i < argc; i++) {
 		orig_argv[i] = strdup(argv[i]);
 		if (!orig_argv[i]) {
-			WARN_GLIBC("strdup(%s)", orig_argv[i]);
+			WARN_GLIBC("strdup(%s)", argv[i]);
 			exit(1);
 		}
 	};
-- 
2.48.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-03-28 13:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-26  1:30 [PATCH] objtool: Fix NULL printf() '%s' argument Josh Poimboeuf
2025-03-26  4:10 ` Stephen Rothwell
2025-03-26  7:26   ` Ingo Molnar
2025-03-26 13:13     ` Stephen Rothwell
2025-03-26  7:31 ` [tip: objtool/urgent] objtool: Fix NULL printf() '%s' argument in builtin-check.c:save_argv() tip-bot2 for Josh Poimboeuf
2025-03-27 11:06 ` tip-bot2 for Josh Poimboeuf
2025-03-28 13:48 ` tip-bot2 for Josh Poimboeuf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®