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
This commit is contained in:
hidnplayr 2008-01-20 20:51:24 +00:00
parent b66406549f
commit 7941c117bc

View File

@ -16,12 +16,14 @@ DRV_VERSION equ (DRV_COMPAT shl 16) or DRV_CURRENT
align 4 align 4
proc attach_int_handler stdcall, irq:dword, handler:dword proc attach_int_handler stdcall, irq:dword, handler:dword
mov ebx, [irq] ;irq num mov ebx, [irq] ; irq num
test ebx, ebx test ebx, ebx
jz .err jz .err
mov eax, [handler] cmp ebx, 15 ; hidnplayr says: we only have 16 IRQ's
jg .err
mov eax, [handler]
test eax, eax test eax, eax
jz .err jz .err
mov [irq_tab+ebx*4], eax mov [irq_tab+ebx*4], eax
stdcall enable_irq, [irq] stdcall enable_irq, [irq]
ret ret