From 264f3b2be220e3cbad5edf25427de4dd768ca062 Mon Sep 17 00:00:00 2001
From: wangxindsb <“wangxindsb@gmail.com”>
Date: Thu, 30 Mar 2017 20:32:12 -0700
Subject: [PATCH] ext2 Volume: check some more value for ext2_super_block
---
src/add-ons/kernel/file_systems/ext2/Volume.cpp | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/src/add-ons/kernel/file_systems/ext2/Volume.cpp b/src/add-ons/kernel/file_systems/ext2/Volume.cpp
index 3b59251..c115081 100644
a
|
b
|
ext2_super_block::IsValid()
|
207 | 207 | || BlocksPerGroup() != (1UL << BlockShift()) * 8 |
208 | 208 | || InodeSize() > (1UL << BlockShift()) |
209 | 209 | || RevisionLevel() > EXT2_MAX_REVISION |
210 | | || ReservedGDTBlocks() > (1UL << BlockShift()) / 4) |
| 210 | || ReservedGDTBlocks() > (1UL << BlockShift()) / 4 |
| 211 | || GroupDescriptorSize() > EXT2_BLOCK_GROUP_64BIT_SIZE || GroupDescriptorSize() < EXT2_BLOCK_GROUP_NORMAL_SIZE) |
211 | 212 | return false; |
212 | | if (Has64bitFeature()) { |
213 | | if (GroupDescriptorSize() > EXT2_BLOCK_GROUP_64BIT_SIZE || GroupDescriptorSize() < EXT2_BLOCK_GROUP_NORMAL_SIZE) |
214 | | return false; |
215 | | } |
216 | | else { |
217 | | if (GroupDescriptorSize() != EXT2_BLOCK_GROUP_NORMAL_SIZE) |
218 | | return false; |
219 | | } |
220 | 213 | |
221 | 214 | return true; |
222 | 215 | } |