commit | 4f2155518a6a8988c36cb59bcf3af6a17554db17 | [log] [tgz] |
---|---|---|
author | Elliott Hughes <enh@google.com> | Tue Apr 19 22:03:58 2016 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Tue Apr 19 22:03:58 2016 +0000 |
tree | 12d31399da130a68141024fbac79cc998c371a48 | |
parent | 09c5fcf7603f6e75b7859e109a0cec966f00ab3e [diff] | |
parent | a2f37e4fd719722064438d5ca34f88a7fa9a5886 [diff] |
Merge "More secure and compiler warning fix for sprintf into snprintf"
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c index 6bba3a7..7bb8223 100644 --- a/libcutils/sched_policy.c +++ b/libcutils/sched_policy.c
@@ -306,7 +306,7 @@ char thread_name[255]; int fd; - sprintf(statfile, "/proc/%d/stat", tid); + snprintf(statfile, sizeof(statfile), "/proc/%d/stat", tid); memset(thread_name, 0, sizeof(thread_name)); fd = open(statfile, O_RDONLY);