From f19d41bdce188ba9c07fc06dc078015bc81b3e9a Mon Sep 17 00:00:00 2001 From: enh Date: Mon, 31 Jul 2023 07:15:25 -0700 Subject: [PATCH] blkid: fix buffer overflow --- toys/other/blkid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/other/blkid.c b/toys/other/blkid.c index bed20b2c..951f8487 100644 --- a/toys/other/blkid.c +++ b/toys/other/blkid.c @@ -124,7 +124,7 @@ static void do_blkid(int fd, char *name) uint64_t test; // Skip tests not in this 4k block - if (fstypes[i].magic_offset > off+sizeof(toybuf)) { + if (fstypes[i].magic_offset + fstypes[i].magic_len > off+sizeof(toybuf)) { pass++; continue; } -- 2.39.2