We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0394c66 commit d483c29Copy full SHA for d483c29
src/dir/gen3.rs
@@ -150,6 +150,14 @@ impl CodePartitionDirectory {
150
let Ok((header, _)) = CPDHeader::read_from_prefix(data) else {
151
return Err("could not parse CPD header".to_string());
152
};
153
+
154
+ let m = header.magic;
155
+ if m != CPD_MAGIC_BYTES {
156
+ return Err(format!(
157
+ "missing CPD magic; got {m:02x?}, wanted {CPD_MAGIC_BYTES:02x?}"
158
+ ));
159
+ }
160
161
let name = header.name();
162
let header_size = if header.version_or_checksum == 0x00140102 {
163
HEADER_SIZE + 4
0 commit comments