szn

Bug 80 — @intCast before bounds check in Client.sendIdentify — panic in safe builds

80. @intCast before bounds check in Client.sendIdentify — panic in safe builds

File: src/client/client.zig:34–35 Severity: MEDIUM Status: ✅ FIXED — moved the bounds check (term.len > 64) before the @intCast. Unit test added.

var it: protocol.IdentifyTerm = .{ .term_len = @intCast(term.len) };
if (term.len > it.term.len) return error.TermTooLong;

@intCast(term.len) from usize to u8 panics at runtime if term.len > 255. The bounds check on the next line is dead code for the panic path. Move the check before the cast.