From 7941c117bc8ee8fbc33f727556d0aaaa4be0bb76 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Sun, 20 Jan 2008 20:51:24 +0000 Subject: [PATCH] changes to attach_int_handler: detect if int is not larger then 15 (you could probably crash the kernel otherwise) git-svn-id: svn://kolibrios.org@700 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/core/dll.inc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/trunk/core/dll.inc b/kernel/trunk/core/dll.inc index d9951d2584..50f59b47dd 100644 --- a/kernel/trunk/core/dll.inc +++ b/kernel/trunk/core/dll.inc @@ -16,12 +16,14 @@ DRV_VERSION equ (DRV_COMPAT shl 16) or DRV_CURRENT align 4 proc attach_int_handler stdcall, irq:dword, handler:dword - mov ebx, [irq] ;irq num + mov ebx, [irq] ; irq num test ebx, ebx - jz .err - mov eax, [handler] + jz .err + cmp ebx, 15 ; hidnplayr says: we only have 16 IRQ's + jg .err + mov eax, [handler] test eax, eax - jz .err + jz .err mov [irq_tab+ebx*4], eax stdcall enable_irq, [irq] ret