PSeitz / lz4_flex

Fastest pure Rust implementation of LZ4 compression/decompression.
MIT License
460 stars 31 forks source link

Guard against usize overflows/underflows and raw pointer undefined behavior #50

Closed arthurprs closed 2 years ago

arthurprs commented 2 years ago

The main change is to change patterns like current_position + something > max_position to max_position - current_position < something, which is overflow safe. Closes #49

PSeitz commented 2 years ago

Awesome, thanks for the PR!