aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2024-12-24 11:59:25 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-12-24 11:59:25 +0100
commit6b080c5b5a6685d1af842b0a3558db4d1fcf4345 (patch)
treef8c217307e44a6c6e6134708821384fabb159e87
parent7cf6081e2e7db2ff84a8f4dd6f11f32dadb1665d (diff)
downloadgnumach-6b080c5b5a6685d1af842b0a3558db4d1fcf4345.tar.gz
gnumach-6b080c5b5a6685d1af842b0a3558db4d1fcf4345.tar.bz2
gnumach-6b080c5b5a6685d1af842b0a3558db4d1fcf4345.zip
irq: make device_intr_register reject bogus intr id
-rw-r--r--device/ds_routines.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/device/ds_routines.c b/device/ds_routines.c
index 439fc5b3..0db4f8cd 100644
--- a/device/ds_routines.c
+++ b/device/ds_routines.c
@@ -354,6 +354,9 @@ ds_device_intr_register (device_t dev, int id,
if (! name_equal(mdev->dev_ops->d_name, 3, "irq"))
return D_INVALID_OPERATION;
+ if (id < 0 || id >= NINTR)
+ return D_INVALID_OPERATION;
+
user_intr_t *e = insert_intr_entry (&irqtab, id, receive_port);
if (!e)
return D_NO_MEMORY;