Skip to content

Commit 7320774

Browse files
Devaansh-Kumarrostedt
authored andcommitted
tracing: Replace deprecated strncpy() with strscpy() for stack_trace_filter_buf
strncpy() is deprecated for NUL-terminated destination buffers and must be replaced by strscpy(). See issue: KSPP#90 Link: https://lore.kernel.org/[email protected] Signed-off-by: Devaansh Kumar <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 6e3b3ac commit 7320774

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/trace_stack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ static __init int enable_stacktrace(char *str)
542542
int len;
543543

544544
if ((len = str_has_prefix(str, "_filter=")))
545-
strncpy(stack_trace_filter_buf, str + len, COMMAND_LINE_SIZE);
545+
strscpy(stack_trace_filter_buf, str + len);
546546

547547
stack_tracer_enabled = 1;
548548
return 1;

0 commit comments

Comments
 (0)