zhenrong-wang / bcomp

A bit-based, simple algorithm for lossless compression.
MIT License
11 stars 3 forks source link

Decompressing random file fails with buffer overflow. #3

Open MarekKnapek opened 5 months ago

MarekKnapek commented 5 months ago

Create file with length of 4 bytes: 0xff, 0xff, 0x00, 0x00 and try to decompress it. Result is stack buffer overflow accessing variable dict_elem_size, it uses index 3 and index 3. But the array has size only of [4][3] elements.

zhenrong-wang commented 5 months ago

Added precheck and crosscheck to decompression, this issue should be resolved.