0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.0025: accessing beyond allocated memory with the cmdline window

Problem:    Accessing beyond allocated memory when using the cmdline window in
            Ex mode.
Solution:   Use "*" instead of "'<,'>" for Visual mode.
This commit is contained in:
Bram Moolenaar
2022-07-02 13:43:21 +01:00
parent af043e12d9
commit c6fdb15d42
3 changed files with 14 additions and 2 deletions

View File

@@ -3118,9 +3118,11 @@ parse_command_modifiers(
size_t len = STRLEN(cmd_start);
// Special case: empty command uses "+":
// "'<,'>mods" -> "mods'<,'>+
// "'<,'>mods" -> "mods *+
// Use "*" instead of "'<,'>" to avoid the command getting
// longer, in case is was allocated.
mch_memmove(orig_cmd, cmd_start, len);
STRCPY(orig_cmd + len, "'<,'>+");
STRCPY(orig_cmd + len, " *+");
}
else
{