* [PATCH linux-next] clocksource: use strscpy() to instead of strlcpy()
@ 2022-11-24 11:24 yang.yang29
0 siblings, 0 replies; only message in thread
From: yang.yang29 @ 2022-11-24 11:24 UTC (permalink / raw)
To: jstultz; +Cc: tglx, sboyd, linux-kernel, xu.panda, yang.yang29
From: Xu Panda <xu.panda@zte.com.cn>
The implementation of strscpy() is more robust and safer.
That's now the recommended way to copy NUL terminated strings.
Signed-off-by: Xu Panda <xu.panda@zte.com.cn>
Signed-off-by: Yang Yang <yang.yang29@zte.com>
---
kernel/time/clocksource.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 4a2c3bb92e2e..d59b05409a22 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -1450,7 +1450,7 @@ static int __init boot_override_clocksource(char* str)
{
mutex_lock(&clocksource_mutex);
if (str)
- strlcpy(override_name, str, sizeof(override_name));
+ strscpy(override_name, str, sizeof(override_name));
mutex_unlock(&clocksource_mutex);
return 1;
}
--
2.15.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-24 11:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-24 11:24 [PATCH linux-next] clocksource: use strscpy() to instead of strlcpy() yang.yang29
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox