Skip to content

Commit

Permalink
kernel/vfs: Sanity checks before performing reads/writes
Browse files Browse the repository at this point in the history
  • Loading branch information
ry755 committed Sep 14, 2023
1 parent 9ae1e47 commit d41fcd8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions kernel/vfs/vfs.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d41fcd8

Please sign in to comment.