2
0
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:
Todd C. Miller
2003-03-12 23:46:54 +00:00
parent 35b2800a8a
commit 804caf3956

2
sudo.c
View File

@@ -525,7 +525,7 @@ init_vars(sudo_mode)
char pw_name[MAX_UID_T_LEN + 1];
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;
sudo_user.pw = &pw;