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)
1cbfc9914d

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)
3b5fef6a99

vim-patch:8.1.1774: test is silently skipped

Problem:    Test is silently skipped.
Solution:   Throw "Skipped".
3c610c9638

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)
96916ac67a

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)
c478ee3d83

vim-patch:8.2.2077: build failure with small features

Problem:    Build failure with small features.
Solution:   Add #ifdef.
a452b808b4

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)
476268c387
This commit is contained in:
Jan Edmund Lazo
2020-12-02 18:54:06 -05:00
parent f5e0f17968
commit c6b780bdd1
2 changed files with 16 additions and 2 deletions

View File

@@ -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 {

View File

@@ -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