From 7f27268c86bcb54a79854bb16d3c2631cb10ff80 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 27 Mar 2024 08:58:50 -0400 Subject: kernel: initramfs: Fix indexing/buffer overflow bug Signed-off-by: Ian Moffett --- sys/fs/initramfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys') 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; -- cgit v1.2.3