]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lslocks: use snprintf() rather than sprintf()
authorKarel Zak <kzak@redhat.com>
Tue, 27 Jul 2021 11:30:56 +0000 (13:30 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 27 Jul 2021 11:30:56 +0000 (13:30 +0200)
misc-utils/lslocks.c

index 941ef7f06de1cc639d3e9c7e1d72c585cbf30b58..a5adb0d41600ad9192e4c74177e7dce1e3f09da8 100644 (file)
@@ -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;