aboutsummaryrefslogtreecommitdiff
path: root/lib/debugobjects.c
diff options
context:
space:
mode:
authorNathan Chancellor <[email protected]>2020-01-30 15:16:44 -0700
committerPetr Mladek <[email protected]>2020-02-11 13:01:00 +0100
commit5661dd95a2958634485bb1a53f90a6ab621d4b0c (patch)
tree84d284668a4b97f8be8a83e36ce2206d7e1d30a7 /lib/debugobjects.c
parenta4fe2b4d87c9f2298ae6a641a7a64bc941d079d0 (diff)
printk: Convert a use of sprintf to snprintf in console_unlock
When CONFIG_PRINTK is disabled (e.g. when building allnoconfig), clang warns: ../kernel/printk/printk.c:2416:10: warning: 'sprintf' will always overflow; destination buffer has size 0, but format string expands to at least 33 [-Wfortify-source] len = sprintf(text, ^ 1 warning generated. It is not wrong; text has a zero size when CONFIG_PRINTK is disabled because LOG_LINE_MAX and PREFIX_MAX are both zero. Change to snprintf so that this case is explicitly handled without any risk of overflow. Link: https://github.com/ClangBuiltLinux/linux/issues/846 Link: https://github.com/llvm/llvm-project/commit/6d485ff455ea2b37fef9e06e426dae6c1241b231 Link: http://lkml.kernel.org/r/[email protected] Cc: Steven Rostedt <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Nathan Chancellor <[email protected]> Reviewed-by: Sergey Senozhatsky <[email protected]> Signed-off-by: Petr Mladek <[email protected]>
Diffstat (limited to 'lib/debugobjects.c')
0 files changed, 0 insertions, 0 deletions