logindefs: use snprintf() rather than sprintf()

This commit is contained in:
Karel Zak 2021-07-27 13:30:01 +02:00
parent 79fb7e18f4
commit a6d7f918ac
1 changed files with 1 additions and 1 deletions

View 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();