kernel/vfs: Sanity checks before performing reads/writes
This commit is contained in:
parent
9ae1e4710d
commit
d41fcd8817
|
@ -151,6 +151,12 @@ stream_get_size:
|
||||||
; outputs:
|
; outputs:
|
||||||
; none
|
; none
|
||||||
read:
|
read:
|
||||||
|
cmp r0, 0
|
||||||
|
ifz ret
|
||||||
|
cmp r1, 0
|
||||||
|
ifz ret
|
||||||
|
cmp r2, 0
|
||||||
|
ifz ret
|
||||||
push r3
|
push r3
|
||||||
push r1
|
push r1
|
||||||
add r1, 7
|
add r1, 7
|
||||||
|
@ -212,6 +218,10 @@ stream_read_char:
|
||||||
; outputs:
|
; outputs:
|
||||||
; none
|
; none
|
||||||
write:
|
write:
|
||||||
|
cmp r0, 0
|
||||||
|
ifz ret
|
||||||
|
cmp r1, 0
|
||||||
|
ifz ret
|
||||||
push r3
|
push r3
|
||||||
push r1
|
push r1
|
||||||
add r1, 7
|
add r1, 7
|
||||||
|
|
Loading…
Reference in New Issue
Block a user