mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-08-08 06:46:11 +00:00
Addresses review feedback: the 100:1 ratio guard created an encoder/decoder asymmetry — encode() compresses any beneficial payload, but legitimate high-ratio content (repeated text, zero-filled files, >100:1) was then rejected by every receiver, so decode(encode(packet)) failed and messages were silently dropped by all peers. It also diverged from iOS, which enforces no ratio limit. The ratio check is redundant for security: the absolute MAX_PAYLOAD_LENGTH cap plus the bounded streaming decompressor (which never pre-allocates the claimed size) already limit worst-case allocation to actual inflated output. Replaces the ratio-rejection test with a high-ratio round-trip test and updates stale comments on the pre-existing bomb tests.