1
0
forked from aniani/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 #7399)
This commit is contained in:
Bram Moolenaar
2020-12-02 12:37:37 +01:00
parent a452b808b4
commit 1cbfc9914d
3 changed files with 16 additions and 1 deletions

View File

@@ -180,4 +180,13 @@ func Test_setcellwidths()
call assert_fails('call setcellwidths([[0x33, 0x44, 2]])', 'E1114:')
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