diff options
author | dzwdz | 2022-07-01 21:43:49 +0200 |
---|---|---|
committer | dzwdz | 2022-07-01 21:43:49 +0200 |
commit | 331f63bc7e8e80e914bb8fb93ef48381bc737feb (patch) | |
tree | fad621975d70d30efda657af79622f727d4a4d83 | |
parent | cf8ec3d3623f24cec91025ebdf1237935a970e40 (diff) |
kernel/fsroot: respect offset when reading root
-rw-r--r-- | src/kernel/arch/i386/driver/fsroot.c | 4 |
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: { |