mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
7e5a816749
Firstly, lots of places in editor(1) would do a move from (x₀,y₀) to (x,y) by first moving to (x,y₀) or (x₀,y) and only then (x,y). If the intermediate positions were not valid cursor positions, this might cause out of bounds access. Categorically fixed this by removing functions for moving only horizontally or only vertically. Secondly, editor_select_set() would set the column before setting the line. Since the code for setting the column accesses the currently set line at the new cursor position, it might cause out of bounds access even on valid cursor positions. Fixed this by swapping the order in which column and row are set. Thirdly, the order of arguments passed to row_column_smallest() and row_column_biggest() was wrong, with column being passed before the row, even though they were defined the other way. However, this did not result in out of bounds memory accesses due to the parameters to editor_cursor_set() also being swapped at relevant callsites. Finally, the boundary condition for control-down was off by one. |
||
---|---|---|
.. | ||
.gitignore | ||
command.c | ||
command.h | ||
cursor.c | ||
cursor.h | ||
display.c | ||
display.h | ||
editor.1 | ||
editor.5 | ||
editor.c | ||
editor.h | ||
highlight.c | ||
highlight.h | ||
input.c | ||
input.h | ||
Makefile | ||
modal.c | ||
modal.h | ||
multibyte.c | ||
multibyte.h | ||
terminal.c | ||
terminal.h |