From 33d3d53139ffd43604ce598625ef87f5bcc58e57 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 7 Oct 2025 11:57:06 +0200 Subject: [PATCH] dmesg: use snprintf() instead of sprintf() Signed-off-by: Karel Zak --- sys-utils/dmesg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index 6584613c7..f4b048400 100644 --- a/sys-utils/dmesg.c +++ b/sys-utils/dmesg.c @@ -1273,7 +1273,7 @@ full_output: } else { char cidbuf[PID_CHARS_MAX+3] = {'\0'}; - sprintf(cidbuf, "[%*s] ", + snprintf(cidbuf, sizeof(cidbuf), "[%*s] ", (char)ctl->caller_id_size, rec->caller_id); ctl->indent += strnlen(cidbuf, sizeof(cidbuf)); fputs(cidbuf, stdout); -- 2.47.3