From 13ac9a9641fb47e5eefe370535b89fa6b95752a3 Mon Sep 17 00:00:00 2001 From: offsoc <139764790+offsoc@users.noreply.github.com> Date: Mon, 23 Sep 2024 13:57:59 +0800 Subject: [PATCH] Fix code scanning alert #10: Likely overrunning write Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- arch/x86/kernel/hpet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index c96ae8fee95e44..fc5d376f8e4ee7 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c @@ -728,7 +728,7 @@ static void __init hpet_select_clockevents(void) if (!(hc->boot_cfg & HPET_TN_FSB_CAP)) continue; - sprintf(hc->name, "hpet%d", i); + snprintf(hc->name, sizeof(hc->name), "hpet%d", i); irq = hpet_assign_irq(hpet_domain, hc, hc->num); if (irq <= 0)