File tree Expand file tree Collapse file tree
Sources/ContainerizationEXT4 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -710,9 +710,15 @@ extension EXT4 {
710710 for i in 0 ... usedGroupDescriptorBlocks {
711711 bitmap [ Int ( i / 8 ) ] |= 1 << ( i % 8 )
712712 }
713- for i in usedGroupDescriptorBlocks + 1 ... self . groupDescriptorBlocks {
714- bitmap [ Int ( i / 8 ) ] &= ~ ( 1 << ( i % 8 ) )
715- blocks -= 1
713+ // Bug #20 (HIGH): The original range usedGroupDescriptorBlocks+1...self.groupDescriptorBlocks
714+ // crashed with "Range requires lowerBound <= upperBound" when all descriptor blocks were used
715+ // (lower > upper). Fixed by guarding that the range is non-empty first.
716+ // Same fix: sonnet-bulk, sonnet-1m. All other branches can crash here.
717+ if usedGroupDescriptorBlocks + 1 <= self . groupDescriptorBlocks {
718+ for i in usedGroupDescriptorBlocks + 1 ... self . groupDescriptorBlocks {
719+ bitmap [ Int ( i / 8 ) ] &= ~ ( 1 << ( i % 8 ) )
720+ blocks -= 1
721+ }
716722 }
717723 }
718724
You can’t perform that action at this time.
0 commit comments