mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 14:25:15 +00:00
Use snprintf() for paranoia
This commit is contained in:
2
sudo.c
2
sudo.c
@@ -525,7 +525,7 @@ init_vars(sudo_mode)
|
|||||||
char pw_name[MAX_UID_T_LEN + 1];
|
char pw_name[MAX_UID_T_LEN + 1];
|
||||||
|
|
||||||
pw.pw_uid = getuid();
|
pw.pw_uid = getuid();
|
||||||
(void) sprintf(pw_name, "%ld", (long) pw.pw_uid);
|
(void) snprintf(pw_name, sizeof(pw_name), "%ld", (long) pw.pw_uid);
|
||||||
pw.pw_name = pw_name;
|
pw.pw_name = pw_name;
|
||||||
sudo_user.pw = &pw;
|
sudo_user.pw = &pw;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user