mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
fix: memory corruption in Screen.cursorAbsolute
We call `cursorChangePin` which may invalidate the provided pin if it needs to adjust the page capacity, and as such we should consider the pin we pass in to it invalid afterwards, and access it through cursor instead.
This commit is contained in:
@ -620,7 +620,7 @@ pub fn cursorAbsolute(self: *Screen, x: size.CellCountInt, y: size.CellCountInt)
|
||||
self.cursor.x = x; // Must be set before cursorChangePin
|
||||
self.cursor.y = y;
|
||||
self.cursorChangePin(page_pin);
|
||||
const page_rac = page_pin.rowAndCell();
|
||||
const page_rac = self.cursor.page_pin.rowAndCell();
|
||||
self.cursor.page_row = page_rac.row;
|
||||
self.cursor.page_cell = page_rac.cell;
|
||||
}
|
||||
|
Reference in New Issue
Block a user