summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-06-20 01:09:48 -0400
committerIan Moffett <ian@osmora.org>2025-06-20 01:09:48 -0400
commit8688a083ab2d5e2fa0da737724cf12d130b4127f (patch)
tree57c84dd73e1f9c2baf905ec08e83327acb7b6bf5 /sys
parent7d12f15bb569b47d4c8a70e5ec81ad5e3409dcf0 (diff)
kernel/amd64: intr: Ensure intr_hand.name has '\0'
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/intr.c2
-rw-r--r--sys/include/arch/amd64/intr.h2
2 files changed, 3 insertions, 1 deletions
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.
*