mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-05 17:43:09 -05:00
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: c5995abe15 ("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
This commit is contained in:
committed by
Ingo Molnar
parent
05026ea01e
commit
d9a595c385
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user