]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
kcsan: test: Replace deprecated strcpy() with strscpy()
authorThorsten Blum <thorsten.blum@linux.dev>
Fri, 15 Aug 2025 21:37:44 +0000 (23:37 +0200)
committerMarco Elver <elver@google.com>
Tue, 19 Aug 2025 10:52:12 +0000 (12:52 +0200)
strcpy() is deprecated; use strscpy() instead.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Justin Stitt <justinstitt@google.com>
Signed-off-by: Marco Elver <elver@google.com>
kernel/kcsan/kcsan_test.c

index 49ab81faaed95f4f1f13edf1f7e7a8c5ef3fabcb..ea1cb4c8a894aa8c00a758a637b4e1c76a43318c 100644 (file)
@@ -125,7 +125,7 @@ static void probe_console(void *ignore, const char *buf, size_t len)
                                goto out;
 
                        /* No second line of interest. */
-                       strcpy(observed.lines[nlines++], "<none>");
+                       strscpy(observed.lines[nlines++], "<none>");
                }
        }
 
@@ -231,7 +231,7 @@ static bool __report_matches(const struct expect_report *r)
 
                        if (!r->access[1].fn) {
                                /* Dummy string if no second access is available. */
-                               strcpy(cur, "<none>");
+                               strscpy(expect[2], "<none>");
                                break;
                        }
                }