server/render.zig — self.sy - 1 underflows when sy == 0server/render.zig — self.sy - 1 underflows when sy == 0File: src/server/render.zig:72, 228, 359
Severity: MEDIUM
Status: ✅ FIXED — replaced - with -| (saturating subtraction) in all three locations. Test added.
const merged_h = self.sy - 1;
const h = @min(screen.grid.height, self.sy - 1);
try self.moveTo(0, self.sy - 1);
sy is u32. If sy == 0, self.sy - 1 wraps to 4294967295. This causes merged_h to be ~4 billion, leading to massive allocation in Screen.init, or the render loop iterating an absurd number of times. While server.zig clamps sy to >= 24, the Display type itself has no guard.