mirror of
https://github.com/oven-sh/bun
synced 2026-02-18 06:41:50 +00:00
When the MySQL client receives a packet with the maximum possible length (0xFFFFFF), adding PacketHeader.size (4 bytes) causes an integer overflow. This was causing a panic with "integer overflow" when fuzzing the MySQL client with malformed packets. The fix adds a check before buffer allocation to ensure the packet length is within safe bounds. If a packet exceeds the maximum safe size (0xFFFFFF - 4), the connection is forcefully closed with an InvalidEncodedLength error instead of panicking. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>