kernel/vfs: Sanity checks before performing reads/writes

This commit is contained in:
Ry 2023-09-14 14:58:10 -07:00
parent 9ae1e4710d
commit d41fcd8817

View File

@ -151,6 +151,12 @@ stream_get_size:
; outputs:
; none
read:
cmp r0, 0
ifz ret
cmp r1, 0
ifz ret
cmp r2, 0
ifz ret
push r3
push r1
add r1, 7
@ -212,6 +218,10 @@ stream_read_char:
; outputs:
; none
write:
cmp r0, 0
ifz ret
cmp r1, 0
ifz ret
push r3
push r1
add r1, 7