aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/bin
diff options
context:
space:
mode:
authorJacob Keller <[email protected]>2017-07-12 05:46:09 -0400
committerJeff Kirsher <[email protected]>2017-08-27 15:43:41 -0700
commitb5d5504aa1e961fc1f87ee7b092bf5ce1a7bf0de (patch)
tree3d140048ed1b817db5e09e222beba802a1841245 /tools/perf/scripts/python/bin
parented601f660131be6bb9a8a109b0f2bf031786100f (diff)
i40e: prevent snprintf format specifier truncation
Increase the size of the prefix buffer so that it can hold enough characters for every possible input. Although 20 is enough for all expected inputs, it is possible for the values to be larger than expected, resulting in a possibly truncated string. Additionally, lets use sizeof(prefix) in order to ensure we use the correct size if we need to change the array length in the future. New versions of GCC starting at 7 now include warnings to prevent truncation unless you handle the return code. At most 27 bytes can be written here, so lets just increase the buffer size even if for all expected hw->bus.* values we only needed 20. Signed-off-by: Jacob Keller <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions