Sensirion / sensirion-i2c-rs

Rust library with common functionality for our I2C sensors
BSD 3-Clause "New" or "Revised" License
12 stars 8 forks source link

Assert in crc8::validate that buffer size is a multiple of 3 #13

Closed rnestler closed 4 years ago

rnestler commented 4 years ago

Previously crc8::validate would only panic in debug builds, but not in release builds when passing in buffers with a size which isn't a multiple of 3. In release builds the remaining bytes just wouldn't get validated.

Fixes #10