x86/hpet: use strscpy() is more robust and safer
PATCH 1/1 x86/hpet: use strscpy() is more robust and safer
From: Minghao Chi <[email protected]>
The implementation of strscpy() is more robust and safer.
That's now the recommended way to copy NUL terminated strings.
Reported-by Zeal Robot <[email protected]>
Signed-off-by Minghao Chi <[email protected]>
--- arch/x86/kernel/hpet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/hpet.c +1 -1
@@ -421,7 +421,7 @@ static void __init hpet_legacy_clockevent_register(struct hpet_channel *hc)* the IO_APIC has been initialized. */ hc->cpu = boot_cpu_data.cpu_index; -strncpy (hc->name,"hpet" ,sizeof (hc->name)); +strscpy (hc->name,"hpet" ,sizeof (hc->name));hpet_init_clockevent (hc,50 ); hc->evt.tick_resume = hpet_clkevt_legacy_resume;
Signature · 1 line
2.25.1