mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-11-22 08:17:28 +00:00
The decoder accepted a payload of any type up to the framed-file ceiling, compressed or not, and the stores holding decoded packets evicted by count only. - New PacketPayloadLimits (BitFoundation): per-type decoded payload caps, enforced in BinaryProtocol.decodeCore for compressed and uncompressed payloads. Only fileTransfer and noiseEncrypted keep the framed-file cap; every other type is capped at >= 2x the largest payload current iOS and Android encoders produce. - The unreachable 50,000:1 ratio guard becomes DEFLATE's 1032:1 bound. - Fragment reassembly is limited by the claimed type's frame ceiling, and a reassembled packet of a different type is dropped. - Gossip PacketStores, archive restore and the directed relay spool get byte budgets alongside their count caps. - Broadcast file transfers are validated before being tracked for sync. - Public mesh messages larger than a v1 frame are not delivered. Receive-side only; senders and the wire format are unchanged. Also: a re-delivered fragment replaces its index's bytes in the assembly size projection instead of counting twice, and a test-harness race in GossipSyncManagerTests.concurrentPacketIntakeAndSyncRequest is fixed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>