mirror of
https://github.com/Ap0dexMe0/unixtract.git
synced 2026-07-15 21:00:03 +02:00
tsb_bin: fix false detection when header is all zeros
This commit is contained in:
@@ -65,5 +65,5 @@ pub fn is_valid_header_checksum(header_data: &[u8]) -> bool {
|
|||||||
//expected checksum at end
|
//expected checksum at end
|
||||||
let exp = u32::from_be_bytes(header_data[252..256].try_into().unwrap());
|
let exp = u32::from_be_bytes(header_data[252..256].try_into().unwrap());
|
||||||
|
|
||||||
calc == exp
|
calc == exp && exp != 0 /* for false positive (SHOULD BE IMPROVED) */
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user