Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions broodmap/src/chk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,16 @@ mod tests {
));
}

#[test]
fn default_limits_accept_many_padding_chunks_for_one_tag() {
// A released map (Tribe Control 1.4) pads its CHK with 16,396 mostly empty chunks under an
// all-zero tag.
let data = chunk(*b"\0\0\0\0", &[]).repeat(16 * 1024 + 12);

let sections = gather_chunk_map(&data, &ResourceLimits::default()).unwrap();
assert_eq!(sections[b"\0\0\0\0"].len(), 16 * 1024 + 12);
}

#[test]
fn resource_limit_rejects_oversized_appended_chunk_data() {
let data = [chunk(*b"UNIT", b"abc"), chunk(*b"UNIT", b"def")].concat();
Expand Down
2 changes: 1 addition & 1 deletion broodmap/src/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl Default for ResourceLimits {
max_mpq_file_sectors: 128 * 1024,
max_chk_bytes: 64 * MIB,
max_chk_chunks: 64 * 1024,
max_chk_chunks_per_tag: 16 * 1024,
max_chk_chunks_per_tag: 64 * 1024,
max_merged_chunk_bytes: 64 * MIB,
}
}
Expand Down
Loading