diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2015-12-06 01:41:31 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-12-21 15:46:07 -0800 |
commit | 20b0236628a8a420bfbf8a3d39576e2ed606fce7 (patch) | |
tree | d5a794965057a929b03b257e5fd9470ecaca25fa /tools/perf/scripts/python/export-to-postgresql.py | |
parent | f916774259d60e8ecd2cdd90e712e4c2fc64b947 (diff) |
staging: lustre: fix %.2X versus signed char issue
When char is signed and one of the bytes in lmm happens to have a byte
value above 127, the result of printing that with %.2X will be 8 hex
chars, the first 6 of which are 'F'. Worst case, we'll overrun our
'carefully' allocated buffer.
I didn't have the tenacity to work through the gazillion and seven
layers of macros behind CERROR, but I assume it'll all end at some
function implemented in terms of the kernel's vsnprintf. Use %*phN for
a hexdump. That'll cap the number of dumped bytes at 64. If that's a
problem, the loop could be replaced by "bin2hex(buffer, lmm,
lmm_bytes);".
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions