Skip to content

Commit 6174cf8

Browse files
committed
Add comment explaining why head modification is safe
1 parent d8af4f7 commit 6174cf8

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
@@ -309,7 +309,8 @@ fn construct(mut ctx: Context) -> Vec<u8> {
309309
let mut offset = 12 + ctx.tables.len() * 16;
310310
for (tag, data) in &mut ctx.tables {
311311
if *tag == Tag::HEAD {
312-
// Zero out checksum field in head table.
312+
// Zero out checksum field in head table. The head table has already
313+
// been subset and is guaranteed to have the necessary minimum size.
313314
data.to_mut()[8..12].fill(0);
314315
checksum_adjustment_offset = Some(offset + 8);
315316
}

0 commit comments

Comments
 (0)