fix: potential memory corruption in Screen.cursorScrollAboveRotate

Unless it's guaranteed that the new pin is in the same page as the old
one, `cursor.page_pin` should only be updated through `cursorChangePin`,
not directly.
This commit is contained in:
Qwerasd
2024-12-24 22:47:38 -05:00
parent a719575012
commit 8fdd69b795

View File

@ -878,7 +878,7 @@ pub fn cursorScrollAbove(self: *Screen) !void {
}
fn cursorScrollAboveRotate(self: *Screen) !void {
self.cursor.page_pin.* = self.cursor.page_pin.down(1).?;
self.cursorChangePin(self.cursor.page_pin.down(1).?);
// Go through each of the pages following our pin, shift all rows
// down by one, and copy the last row of the previous page.