aboutsummaryrefslogtreecommitdiff
path: root/test/functional/spell/spellfile_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-04-09 22:02:26 +0300
committerZyX <kp-pav@yandex.ru>2017-04-09 22:02:51 +0300
commitecce981dba367d61be170b535083691dd9c40cd2 (patch)
treec36b55635897530dd91c24399dfeb10f8f814d8b /test/functional/spell/spellfile_spec.lua
parent5b4f07ee86194a7c6032991102c96387581029c9 (diff)
downloadrneovim-ecce981dba367d61be170b535083691dd9c40cd2.tar.gz
rneovim-ecce981dba367d61be170b535083691dd9c40cd2.tar.bz2
rneovim-ecce981dba367d61be170b535083691dd9c40cd2.zip
coverity/13687: Do not allow NUL byte in region names
Diffstat (limited to 'test/functional/spell/spellfile_spec.lua')
-rw-r--r--test/functional/spell/spellfile_spec.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/spell/spellfile_spec.lua b/test/functional/spell/spellfile_spec.lua
index e7ad79c009..4b76077605 100644
--- a/test/functional/spell/spellfile_spec.lua
+++ b/test/functional/spell/spellfile_spec.lua
@@ -58,4 +58,22 @@ describe('spellfile', function()
eq('Vim(set):E759: Format error in spell file',
exc_exec('set spell'))
end)
+ it('errors out when region contains NUL byte', function()
+ meths.set_option('runtimepath', testdir)
+ write_file(testdir .. '/spell/en.ascii.spl',
+ -- ┌ Section identifier (#SN_REGION)
+ -- │ ┌ Section flags (#SNF_REQUIRED or zero)
+ -- │ │ ┌ Section length (4 bytes, MSB first)
+ -- │ │ │
+ spellheader .. '\000\001\000\000\000\008'
+ -- ┌ Regions ┌ End of sections marker
+ .. '01234\00067\255'
+ -- ┌ LWORDTREE tree length (4 bytes)
+ -- │ ┌ KWORDTREE tree length (4 bytes)
+ -- │ │ ┌ PREFIXTREE tree length
+ .. '\000\000\000\000\000\000\000\000\000\000\000\000')
+ meths.set_option('spelllang', 'en')
+ eq('Vim(set):E759: Format error in spell file',
+ exc_exec('set spell'))
+ end)
end)