toolbox ps: replace strcpy with snprintf.

Change-Id: I0fdf9a8d5ab15bcff06cca3f3e7024ab76b219d9
This commit is contained in:
Elliott Hughes 2016-04-29 22:10:40 -07:00
parent 3b9ba98e9e
commit defd249d3d

View file

@ -151,7 +151,7 @@ static int ps_line(int pid, int tid)
if (pw == 0 || (display_flags & SHOW_NUMERIC_UID)) {
snprintf(user, sizeof(user), "%d", (int)stats.st_uid);
} else {
strcpy(user, pw->pw_name);
snprintf(user, sizeof(user), "%s", pw->pw_name);
}
if (ppid_filter != 0 && ppid != ppid_filter) {