diff options
author | Elliott Hughes <enh@google.com> | 2016-04-19 22:23:33 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-04-19 22:23:33 +0000 |
commit | 2af9f2fe82d05c095779957d98c6987958ee9ce8 (patch) | |
tree | b451b4ac58352e8567285957b009fb96600d34f3 | |
parent | e618f6cb367b83774274786bc28badae34a6c638 (diff) | |
parent | e05688a176c27025d59c0a512501a411b56f1bb1 (diff) |
Merge "More secure and compiler warning fix for sprintf into snprintf" am: 4f21555
am: e05688a
* commit 'e05688a176c27025d59c0a512501a411b56f1bb1':
More secure and compiler warning fix for sprintf into snprintf
Change-Id: I93d4ff6d1c2674113d481ff06170d19f31951346
-rw-r--r-- | libcutils/sched_policy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c index b39964397..884ee178e 100644 --- a/libcutils/sched_policy.c +++ b/libcutils/sched_policy.c @@ -337,7 +337,7 @@ int set_sched_policy(int tid, SchedPolicy policy) 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); |