Skip to content

Commit be4dc93

Browse files
committed
1 parent 8499e9f commit be4dc93

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Sources/ContainerizationEXT4/EXT4+Formatter.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,8 +1367,12 @@ extension Date {
13671367
return 0x8000_0000
13681368
}
13691369

1370-
if s > 0x3_7fff_ffff {
1371-
return 0x3_7fff_ffff
1370+
// Bug #23 (HIGH): Upper clamp used 0x3_7fff_ffff instead of the correct EXT4 34-bit
1371+
// seconds field maximum 0x3_ffff_ffff (2^34 − 1). Values between these two constants
1372+
// passed unchecked, writing bits above bit 33 and corrupting the nanosecond field.
1373+
// Same fix: sonnet-fix.
1374+
if s > 0x3_ffff_ffff {
1375+
return 0x3_ffff_ffff
13721376
}
13731377

13741378
// Bug #1 (CRITICAL): UInt64(s) traps with a Swift runtime precondition failure when s is

0 commit comments

Comments
 (0)