summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordzwdz2022-07-01 21:43:49 +0200
committerdzwdz2022-07-01 21:43:49 +0200
commit331f63bc7e8e80e914bb8fb93ef48381bc737feb (patch)
treefad621975d70d30efda657af79622f727d4a4d83 /src
parentcf8ec3d3623f24cec91025ebdf1237935a970e40 (diff)
kernel/fsroot: respect offset when reading root
Diffstat (limited to 'src')
-rw-r--r--src/kernel/arch/i386/driver/fsroot.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/kernel/arch/i386/driver/fsroot.c b/src/kernel/arch/i386/driver/fsroot.c
index 4207541..bea89cd 100644
--- a/src/kernel/arch/i386/driver/fsroot.c
+++ b/src/kernel/arch/i386/driver/fsroot.c
@@ -74,7 +74,9 @@ static int handle(struct vfs_request *req) {
"ps2\0"
"ata/";
int len = min((size_t) req->output.len, sizeof(src));
- virt_cpy_to(req->caller->pages, req->output.buf, src, len);
+ if (req->offset > len) return 0;
+ virt_cpy_to(req->caller->pages, req->output.buf,
+ src + req->offset, len - req->offset);
return len;
}
case HANDLE_VGA: {