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

index bf689ab63947ee84981d6b5d28e2c655fc56608d..89a5dfc3d592beac62d05cdf4d47a5497feaf60e 100644 (file)
@@ -34,7 +34,7 @@ struct proc_tasks *proc_open_tasks(pid_t pid)
        struct proc_tasks *tasks;
        char path[PATH_MAX];
 
-       sprintf(path, "/proc/%d/task/", pid);
+       snprintf(path, sizeof(path), "/proc/%d/task/", pid);
 
        tasks = malloc(sizeof(struct proc_tasks));
        if (tasks) {