Skip to content

Commit e50585b

Browse files
committed
Add comment explaining why head modification is safe
1 parent f7787c8 commit e50585b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ fn construct(mut ctx: Context) -> Vec<u8> {
303303
let mut offset = 12 + ctx.tables.len() * 16;
304304
for (tag, data) in &mut ctx.tables {
305305
if *tag == Tag::HEAD {
306-
// Zero out checksum field in head table.
306+
// Zero out checksum field in head table. The head table has already
307+
// been subset and is guaranteed to have the necessary minimum size.
307308
data.to_mut()[8..12].fill(0);
308309
checksum_adjustment_offset = Some(offset + 8);
309310
}

0 commit comments

Comments
 (0)