1
0
forked from aniani/vim

patch 8.2.3083: crash when passing null string to charclass()

Problem:    Crash when passing null string to charclass().
Solution:   Bail out when string pointer is NULL. (Christian Brabandt,
            closes #8498, closes #8260)
This commit is contained in:
Christian Brabandt
2021-07-02 20:19:31 +02:00
committed by Bram Moolenaar
parent b836f631db
commit 72463f883c
3 changed files with 6 additions and 1 deletions

View File

@@ -2169,6 +2169,8 @@ func Test_charclass()
call assert_equal(1, charclass('.'))
call assert_equal(2, charclass('x'))
call assert_equal(3, charclass("\u203c"))
" this used to crash vim
call assert_equal(0, "xxx"[-1]->charclass())
endfunc
func Test_eventhandler()