From 952715782ae5d05934920b4d986e0c87f724b0cc Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 7 Oct 2025 12:02:44 +0200 Subject: [PATCH] lsfd: use snprintf() instead of sprintf() Signed-off-by: Karel Zak --- lsfd-cmd/sock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lsfd-cmd/sock.c b/lsfd-cmd/sock.c index 2780c9f34..59824b7d0 100644 --- a/lsfd-cmd/sock.c +++ b/lsfd-cmd/sock.c @@ -152,9 +152,9 @@ static void init_sock_content(struct file *file) assert(file->proc); if (is_opened_file(file)) - sprintf(path, "/proc/%d/fd/%d", file->proc->pid, fd); + snprintf(path, sizeof(path), "/proc/%d/fd/%d", file->proc->pid, fd); else - sprintf(path, "/proc/%d/map_files/%"PRIx64 "-%" PRIx64, + snprintf(path, sizeof(path), "/proc/%d/map_files/%"PRIx64 "-%" PRIx64, file->proc->pid, file->map_start, file->map_end); -- 2.47.3