Skip to content

Commit 50110d0

Browse files
committed
1 parent d9f462f commit 50110d0

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
@@ -1372,8 +1372,12 @@ extension Date {
13721372
return 0x8000_0000
13731373
}
13741374

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

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

0 commit comments

Comments
 (0)