0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 9.0.0212: invalid memory access when compiling :unlet

Problem:    Invalid memory access when compiling :unlet.
Solution:   Don't read past the end of the line.
This commit is contained in:
Bram Moolenaar
2022-08-14 21:46:07 +01:00
parent d1d8f6bacb
commit dbdd16b625
3 changed files with 17 additions and 2 deletions

View File

@@ -92,6 +92,12 @@ free_locals(cctx_T *cctx)
int
check_vim9_unlet(char_u *name)
{
if (*name == NUL)
{
semsg(_(e_argument_required_for_str), "unlet");
return FAIL;
}
if (name[1] != ':' || vim_strchr((char_u *)"gwtb", *name) == NULL)
{
// "unlet s:var" is allowed in legacy script.