aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/initramfs.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-27 08:58:50 -0400
committerIan Moffett <ian@osmora.org>2024-03-27 08:58:50 -0400
commit7f27268c86bcb54a79854bb16d3c2631cb10ff80 (patch)
treeaf469c1477f7b28ac06b4c7edb55b923d568c010 /sys/fs/initramfs.c
parentea0630ef550a3ed7bc38d54c8acab6c7ed075aba (diff)
kernel: initramfs: Fix indexing/buffer overflow bug
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/fs/initramfs.c')
-rw-r--r--sys/fs/initramfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/initramfs.c b/sys/fs/initramfs.c
index 897a3d4..00d1020 100644
--- a/sys/fs/initramfs.c
+++ b/sys/fs/initramfs.c
@@ -140,7 +140,7 @@ vop_read(struct vnode *vp, struct sio_txn *sio)
if (i >= size) {
return i + 1;
}
- buf[i] = contents[i];
+ buf[i - sio->offset] = contents[i];
}
return sio->len;