aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-12-02 18:54:06 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-12-03 18:58:23 -0500
commitc6b780bdd1c4c77dde12aaaf5a7b86960c6cfc19 (patch)
tree66397f66d4713a4303107e97a371282cd5c04bf0 /src
parentf5e0f17968eae6770cc0da136d8c9a4b23bc6da2 (diff)
downloadrneovim-c6b780bdd1c4c77dde12aaaf5a7b86960c6cfc19.tar.gz
rneovim-c6b780bdd1c4c77dde12aaaf5a7b86960c6cfc19.tar.bz2
rneovim-c6b780bdd1c4c77dde12aaaf5a7b86960c6cfc19.zip
vim-patch:8.2.2078: illegal memory access when using :print on invalid text
Problem: Illegal memory access when using :print on invalid text. (Dhiraj Mishra) Solution: Check for more composing characters than supported. (closes vim/vim#7399) https://github.com/vim/vim/commit/1cbfc9914db1cb06aaa092fa42eb7a2fc3dc7ad7 N/A patches for version.c: vim-patch:8.1.1013: MS-Windows: Scrolling fails when dividing the screen Problem: MS-Windows: Scrolling fails when dividing the screen. Solution: Position the cursor before calling ScrollConsoleScreenBuffer(). (Nobuhiro Takasaki, closes vim/vim#4115) https://github.com/vim/vim/commit/3b5fef6a995f25a8a8f746896de44df49b69dfdf vim-patch:8.1.1774: test is silently skipped Problem: Test is silently skipped. Solution: Throw "Skipped". https://github.com/vim/vim/commit/3c610c96389bbb5f0fc83f0a515fc8f1b7f515e4 vim-patch:8.2.1164: text cleared by checking terminal properties not redrawn Problem: Text cleared by checking terminal properties not redrawn. (Alexey Radkov) Solution: Mark the screen characters as invalid. (closes vim/vim#6422) https://github.com/vim/vim/commit/96916ac67ad9ed5d79ce87b099f9d01aa4c13745 vim-patch:8.2.2076: MS-Windows console: sometimes drops typed characters Problem: MS-Windows console: sometimes drops typed characters. Solution: Do not wait longer than 10 msec for input. (issue vim/vim#7164) https://github.com/vim/vim/commit/c478ee3d83fab0dba46740f2023c35f743f88316 vim-patch:8.2.2077: build failure with small features Problem: Build failure with small features. Solution: Add #ifdef. https://github.com/vim/vim/commit/a452b808b4da2d272ca4a50865eb8ca89a58f239 vim-patch:8.2.2086: libvterm tests are only run on Linux Problem: Libvterm tests are only run on Linux. Solution: Use static libraries. (Ozaki Kiichi, closes vim/vim#7419) https://github.com/vim/vim/commit/476268c387a05cfda9feaca8d1a5eeb535ed9f49
Diffstat (limited to 'src')
-rw-r--r--src/nvim/message.c7
-rw-r--r--src/nvim/testdir/test_utf8.vim11
2 files changed, 16 insertions, 2 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index f76a408481..ad38e6d060 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -1711,8 +1711,11 @@ void msg_prt_line(char_u *s, int list)
} else if ((l = utfc_ptr2len(s)) > 1) {
col += utf_ptr2cells(s);
char buf[MB_MAXBYTES + 1];
- if (curwin->w_p_lcs_chars.nbsp != NUL && list
- && (utf_ptr2char(s) == 160 || utf_ptr2char(s) == 0x202f)) {
+ if (l >= MB_MAXBYTES) {
+ xstrlcpy(buf, "¿", sizeof(buf));
+ } else if (curwin->w_p_lcs_chars.nbsp != NUL && list
+ && (utf_ptr2char(s) == 160
+ || utf_ptr2char(s) == 0x202f)) {
utf_char2bytes(curwin->w_p_lcs_chars.nbsp, (char_u *)buf);
buf[utfc_ptr2len((char_u *)buf)] = NUL;
} else {
diff --git a/src/nvim/testdir/test_utf8.vim b/src/nvim/testdir/test_utf8.vim
index 8302ccb67f..e8161f8fcb 100644
--- a/src/nvim/testdir/test_utf8.vim
+++ b/src/nvim/testdir/test_utf8.vim
@@ -103,3 +103,14 @@ func Test_list2str_str2list_latin1()
call assert_equal(l, lres)
call assert_equal(s, sres)
endfunc
+
+func Test_print_overlong()
+ " Text with more composing characters than MB_MAXBYTES.
+ new
+ call setline(1, 'axxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
+ s/x/\=nr2char(1629)/g
+ print
+ bwipe!
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab