From 8688a083ab2d5e2fa0da737724cf12d130b4127f Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 20 Jun 2025 01:09:48 -0400 Subject: kernel/amd64: intr: Ensure intr_hand.name has '\0' Signed-off-by: Ian Moffett --- sys/arch/amd64/amd64/intr.c | 2 +- sys/include/arch/amd64/intr.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/arch/amd64/amd64/intr.c b/sys/arch/amd64/amd64/intr.c index 9f70e88..cb38cd8 100644 --- a/sys/arch/amd64/amd64/intr.c +++ b/sys/arch/amd64/amd64/intr.c @@ -106,7 +106,7 @@ intr_register(const char *name, const struct intr_hand *ih) } /* Allocate memory for the name */ - name_len = strlen(name); + name_len = strlen(name) + 1; ih_new->name = dynalloc(name_len); if (ih_new->name == NULL) { dynfree(ih_new); diff --git a/sys/include/arch/amd64/intr.h b/sys/include/arch/amd64/intr.h index 5e3f397..b640e4b 100644 --- a/sys/include/arch/amd64/intr.h +++ b/sys/include/arch/amd64/intr.h @@ -60,6 +60,8 @@ * @irq: Interrupt request number [o] * @vector: Interrupt vector [v] * + * XXX: `name' must be null terminated ('\0') + * * XXX: `irq` can be set to -1 for MSI/MSI-X * interrupts. * -- cgit v1.2.3