szn

Bug 115 — key.zig — @intCast may panic on out-of-range kitty codepoint

115. key.zig — @intCast may panic on out-of-range kitty codepoint

File: src/key.zig:153 Severity: MEDIUM Status: ✅ FIXED — added codepoint > 0x10FFFF guard before @intCast. Invalid codepoints return error.InvalidCsi. Tests added.

return Key{ .char = .{ .code = @intCast(codepoint), .mod = k_mod } };

codepoint is u32 and .code is u21. If a malformed kitty sequence contains a codepoint > 0x1FFFFF, @intCast triggers a safety panic in debug mode and undefined behavior in release-safe.