Mercurial > vim
comparison src/move.c @ 33920:28e1e956f42c v9.0.2159
patch 9.0.2159: screenpos() may crash with neg. column
Commit: https://github.com/vim/vim/commit/ec54af4e26952d954a4cc009f62c80ea01445d30
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue Dec 12 16:43:44 2023 +0100
patch 9.0.2159: screenpos() may crash with neg. column
Problem: screenpos() may crash with neg. column
Solution: validate and correct column
closes: #13669
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 12 Dec 2023 17:00:08 +0100 |
parents | f2dd85a2bfc0 |
children | a522c6c0127b |
comparison
equal
deleted
inserted
replaced
33919:7512223bb93c | 33920:28e1e956f42c |
---|---|
1529 { | 1529 { |
1530 semsg(_(e_invalid_line_number_nr), pos.lnum); | 1530 semsg(_(e_invalid_line_number_nr), pos.lnum); |
1531 return; | 1531 return; |
1532 } | 1532 } |
1533 pos.col = tv_get_number(&argvars[2]) - 1; | 1533 pos.col = tv_get_number(&argvars[2]) - 1; |
1534 if (pos.col < 0) | |
1535 pos.col = 0; | |
1534 pos.coladd = 0; | 1536 pos.coladd = 0; |
1535 textpos2screenpos(wp, &pos, &row, &scol, &ccol, &ecol); | 1537 textpos2screenpos(wp, &pos, &row, &scol, &ccol, &ecol); |
1536 | 1538 |
1537 dict_add_number(dict, "row", row); | 1539 dict_add_number(dict, "row", row); |
1538 dict_add_number(dict, "col", scol); | 1540 dict_add_number(dict, "col", scol); |