From 7f423077ad4b31c931090736f4c28396b671fabf Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 3 Jun 2021 12:52:00 +0100 Subject: [PATCH] Guard against reading beyond partition end when identifying F2FS filesystem. Fixes #578 --- Aaru.Filesystems/F2FS.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Aaru.Filesystems/F2FS.cs b/Aaru.Filesystems/F2FS.cs index c92c12a70..a38ba830a 100644 --- a/Aaru.Filesystems/F2FS.cs +++ b/Aaru.Filesystems/F2FS.cs @@ -73,7 +73,7 @@ namespace Aaru.Filesystems if(Marshal.SizeOf() % imagePlugin.Info.SectorSize != 0) sbSize++; - if(partition.Start + sbAddr >= partition.End) + if(partition.Start + sbAddr + sbSize >= partition.End) return false; byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);