diff options
author | Ian Moffett <ian@osmora.org> | 2025-10-15 13:45:58 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-10-15 13:45:58 -0400 |
commit | 4343f79fb78d9c3e4b2c7e09147cc499562593d2 (patch) | |
tree | 8c807ed533a84f9414c84808872b7d83d5257053 /src/sys/os/os_omar.c | |
parent | 67be54fb64cfcd63dfe3638c507aa7f29bd86ec5 (diff) |
kern: omar: Make OMAR reads offset aware
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/os/os_omar.c')
-rw-r--r-- | src/sys/os/os_omar.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sys/os/os_omar.c b/src/sys/os/os_omar.c index 9ad3739..8e63ae7 100644 --- a/src/sys/os/os_omar.c +++ b/src/sys/os/os_omar.c @@ -258,7 +258,11 @@ initrd_read(struct vop_rw_data *data) len = MIN(data->len, np->size); for (int i = 0; i < len; ++i) { - dest[i] = src[i]; + if ((i + data->off) >= np->size) { + /* End of file */ + return 0; + } + dest[i] = src[data->off + i]; } return len; |