@intCast before bounds check in Client.sendIdentify — panic in safe builds@intCast before bounds check in Client.sendIdentify — panic in safe buildsFile: 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.