mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 17:36:29 +00:00
vim-patch:9.0.2159: screenpos() may crash with neg. column (#26542)
Problem: screenpos() may crash with neg. column
Solution: validate and correct column
closes: vim/vim#13669
ec54af4e26
This commit is contained in:
@@ -1125,6 +1125,9 @@ void f_screenpos(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
semsg(_(e_invalid_line_number_nr), pos.lnum);
|
||||
return;
|
||||
}
|
||||
if (pos.col < 0) {
|
||||
pos.col = 0;
|
||||
}
|
||||
int row = 0;
|
||||
int scol = 0, ccol = 0, ecol = 0;
|
||||
textpos2screenpos(wp, &pos, &row, &scol, &ccol, &ecol, false);
|
||||
|
Reference in New Issue
Block a user