From 09eee8b489c7a43dea56a683c6c350b0f850f00b Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 27 Jul 2021 13:30:56 +0200 Subject: [PATCH] lslocks: use snprintf() rather than sprintf() --- misc-utils/lslocks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c index 941ef7f06d..a5adb0d416 100644 --- a/misc-utils/lslocks.c +++ b/misc-utils/lslocks.c @@ -177,7 +177,7 @@ static char *get_filename_sz(ino_t inode, pid_t lock_pid, size_t *size) * iterate the *entire* filesystem searching * for the damn file. */ - sprintf(path, "/proc/%d/fd/", lock_pid); + snprintf(path, sizeof(path), "/proc/%d/fd/", lock_pid); if (!(dirp = opendir(path))) return NULL; -- 2.47.2