aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-03-29 10:07:14 +0800
committerGitHub <noreply@github.com>2025-03-29 02:07:14 +0000
commit2681e1fce3c4d8e88f3c573378985d84c4f032cf (patch)
tree9feb121d4c6303868beee4d629bbdac2767a27f3 /src
parentcb31663663b9be92dd9c2fbe06ccea88625b2fca (diff)
downloadrneovim-2681e1fce3c4d8e88f3c573378985d84c4f032cf.tar.gz
rneovim-2681e1fce3c4d8e88f3c573378985d84c4f032cf.tar.bz2
rneovim-2681e1fce3c4d8e88f3c573378985d84c4f032cf.zip
fix(pum): fix heap-buffer-overflow with 'rightleft' (#33146)
Diffstat (limited to 'src')
-rw-r--r--src/nvim/popupmenu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/popupmenu.c b/src/nvim/popupmenu.c
index b1c6e02449..d26651fb84 100644
--- a/src/nvim/popupmenu.c
+++ b/src/nvim/popupmenu.c
@@ -686,13 +686,13 @@ void pum_redraw(void)
char *rt_start = rt;
int cells = vim_strsize(rt);
- if (cells > pum_width) {
+ if (grid_col - cells < col_off - pum_width) {
do {
cells -= utf_ptr2cells(rt);
MB_PTR_ADV(rt);
- } while (cells > pum_width);
+ } while (grid_col - cells < col_off - pum_width);
- if (cells < pum_width) {
+ if (grid_col - cells > col_off - pum_width) {
// Most left character requires 2-cells but only 1 cell is available on
// screen. Put a '<' on the left of the pum item.
*(--rt) = '<';