commit | defd249d3d54f6e86919ace8ea44934138aa1fb8 | [log] [tgz] |
---|---|---|
author | Elliott Hughes <enh@google.com> | Fri Apr 29 22:10:40 2016 -0700 |
committer | Elliott Hughes <enh@google.com> | Fri Apr 29 22:10:40 2016 -0700 |
tree | 07442d117d248d5be59a52a3fd49a9a45ff6f40c | |
parent | 3b9ba98e9eda85baa6f08409177fd1f23307b2d0 [diff] [blame] |
toolbox ps: replace strcpy with snprintf. Change-Id: I0fdf9a8d5ab15bcff06cca3f3e7024ab76b219d9
diff --git a/toolbox/ps.c b/toolbox/ps.c index 3b3c8a1..c129110 100644 --- a/toolbox/ps.c +++ b/toolbox/ps.c
@@ -151,7 +151,7 @@ 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) {