CVE-2025-66216: Ais Catcher Cve 2025 66216 Bit Byte Bounds Confusion

Bit-vs-byte unit confusion in bounds check against MAX_AIS_LENGTH. The constant MAX_AIS_LENGTH is defined in bits (MAX_AIS_BYTES * 8 = 1024), but shifting the index by `>> 3` converts it to bytes before the comparison. The guard therefore only fires when the bit index reaches ~8x the real buffer capacity, permitting a heap buffer overflow in the subsequent b

Provally CuratedPublic repositoryHighHigh confidenceVerifiedApache-2.0C++
greprules fetch cve-2025-66216-ais-catcher-cve-2025-66216-bit-byte-bounds-confusion --engine opengrep

Description

Bit-vs-byte unit confusion in bounds check against MAX_AIS_LENGTH. The constant MAX_AIS_LENGTH is defined in bits (MAX_AIS_BYTES * 8 = 1024), but shifting the index by `>> 3` converts it to bytes before the comparison. The guard therefore only fires when the bit index reaches ~8x the real buffer capacity, permitting a heap buffer overflow in the subsequent b