Skip to content

Commit

Permalink
overflow bug in crc combine
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonJMLarsson committed Dec 22, 2022
1 parent 8431d9e commit ab188ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/crc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl Crc {

/// Combine the CRC with the CRC for the subsequent block of bytes.
pub fn combine(&mut self, additional_crc: &Crc) {
self.amt += additional_crc.amt;
self.amt = self.amt.wrapping_add(additional_crc.amt);
self.hasher.combine(&additional_crc.hasher);
}
}
Expand Down

0 comments on commit ab188ff

Please sign in to comment.