diff src/vim9cmds.c @ 29744:1e9ee1b61d6d v9.0.0212

patch 9.0.0212: invalid memory access when compiling :unlet Commit: https://github.com/vim/vim/commit/dbdd16b62560413abcc3c8e893cc3010ccf31666 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 14 21:46:07 2022 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Sun, 14 Aug 2022 23:00:04 +0200
parents 2da1753e6a4a
children d269dd3cd31d
line wrap: on
line diff
--- a/src/vim9cmds.c
+++ b/src/vim9cmds.c
@@ -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.