From: Karel Zak Date: Tue, 27 Jul 2021 11:30:56 +0000 (+0200) Subject: lslocks: use snprintf() rather than sprintf() X-Git-Tag: v2.38-rc1~346 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09eee8b489c7a43dea56a683c6c350b0f850f00b;p=thirdparty%2Futil-linux.git lslocks: use snprintf() rather than sprintf() --- 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;