diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-05-12 12:04:18 +0200 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2024-05-12 12:19:29 +0200 |
commit | 91a4938edfd3c0382746a8b7b72cb97ab4a6c7ef (patch) | |
tree | 267bd07848fb99de9d8290102a3cf17b04ca5850 /src/nvim/api/ui.c | |
parent | c1396afa7c41c2009d06a54c8aaf1ca5689a9786 (diff) | |
download | rneovim-91a4938edfd3c0382746a8b7b72cb97ab4a6c7ef.tar.gz rneovim-91a4938edfd3c0382746a8b7b72cb97ab4a6c7ef.tar.bz2 rneovim-91a4938edfd3c0382746a8b7b72cb97ab4a6c7ef.zip |
fix(ui): data corruption in remote_ui_raw_line
This particular repro is quite niche but there could be other cases,
whenever the the second last cell plus the "fill" cell togheter are too
complex
Diffstat (limited to 'src/nvim/api/ui.c')
-rw-r--r-- | src/nvim/api/ui.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 93be51e458..fdf25c75d7 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -778,7 +778,7 @@ void remote_ui_raw_line(RemoteUI *ui, Integer grid, Integer row, Integer startco for (size_t i = 0; i < ncells; i++) { repeat++; if (i == ncells - 1 || attrs[i] != attrs[i + 1] || chunk[i] != chunk[i + 1]) { - if (UI_BUF_SIZE - BUF_POS(ui) < 2 * (1 + 2 + sizeof(schar_T) + 5 + 5) + 1 + if (UI_BUF_SIZE - BUF_POS(ui) < 2 * (1 + 2 + MAX_SCHAR_SIZE + 5 + 5) + 1 || ui->ncells_pending >= 500) { // close to overflowing the redraw buffer. finish this event, // flush, and start a new "grid_line" event at the current position. |