]> Gentwo Git Trees - linux/.git/commitdiff
tracing: probes: Replace strcpy() with memcpy() in __trace_probe_log_err()
authorThorsten Blum <thorsten.blum@linux.dev>
Thu, 25 Sep 2025 00:56:49 +0000 (09:56 +0900)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Fri, 31 Oct 2025 16:10:29 +0000 (01:10 +0900)
strcpy() is deprecated; use memcpy() instead.

Link: https://lore.kernel.org/all/20250820214717.778243-3-thorsten.blum@linux.dev/
Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
kernel/trace/trace_probe.c

index 5b92376a58fcbc03b3df6a9d0d8a5d2a02372ad4..bb67f6a2136c4f8f790bd5e7e76b1b6f627a7630 100644 (file)
@@ -215,7 +215,7 @@ void __trace_probe_log_err(int offset, int err_type)
        p = command;
        for (i = 0; i < trace_probe_log.argc; i++) {
                len = strlen(trace_probe_log.argv[i]);
-               strcpy(p, trace_probe_log.argv[i]);
+               memcpy(p, trace_probe_log.argv[i], len);
                p[len] = ' ';
                p += len + 1;
        }