diff options
author | Siddarth G <siddarthsgml@gmail.com> | 2025-03-25 23:42:32 +0530 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2025-03-25 17:44:32 -0400 |
commit | e0344f9564f5847dc20e245fbea67a4b262ee659 (patch) | |
tree | 5159474873510e17947b157e0a485c03f2ecd1b9 /tools/perf/scripts/python/stackcollapse.py | |
parent | 4d38328eb442dc06aec4350fd9594ffa6488af02 (diff) | |
download | lwn-e0344f9564f5847dc20e245fbea67a4b262ee659.tar.gz lwn-e0344f9564f5847dc20e245fbea67a4b262ee659.zip |
tracing: Replace strncpy with memcpy for fixed-length substring copy
checkpatch.pl reports the following warning:
WARNING: Prefer strscpy, strscpy_pad, or __nonstring over strncpy
(see: https://github.com/KSPP/linux/issues/90)
In synth_field_string_size(), replace strncpy() with memcpy() to copy 'len'
characters from 'start' to 'buf'. The code manually adds a NUL terminator
after the copy, making memcpy safe here.
Link: https://lore.kernel.org/20250325181232.38284-1-siddarthsgml@gmail.com
Signed-off-by: Siddarth G <siddarthsgml@gmail.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions