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

index 97150dc284e87b572fb3ab40fdec8a49d251da9b..ee35f6cae7aefd6ed7fa80c25127056ede45b25d 100644 (file)
@@ -521,7 +521,7 @@ int get_hushlogin_status(struct passwd *pwd, int force_check)
                if (strlen(pwd->pw_dir) + strlen(file) + 2 > sizeof(buf))
                        continue;
 
-               sprintf(buf, "%s/%s", pwd->pw_dir, file);
+               snprintf(buf, sizeof(buf), "%s/%s", pwd->pw_dir, file);
 
                if (force_check) {
                        uid_t ruid = getuid();