szn

Bug 470 — Copy-mode getCellAtY_i64 can overflow on extreme offsets

470. INT64_MIN negation + wrapping offset add

Severity: LOW Status: ✅ FIXED Files: src/mode_copy.zig


Root Cause Analysis

In src/mode_copy.zig:304-307,313-316:

extra = @as(u32, @intCast(-y_i64)); // traps for INT64_MIN
return getCellAtOffset(..., scroll_offset + extra); // wrapping +

Inputs are ±history today, but there is no +|/saturate or empty early-return.

Proposed Fix

Saturate the negation/addition and return empty (null cell) on overflow instead of wrapping.