Mercurial > vim
comparison src/ex_docmd.c @ 22724:51bc501a13ca v8.2.1910
patch 8.2.1910: reading past the end of the command line
Commit: https://github.com/vim/vim/commit/caf73dcfade0a435ea3f989285b43f07c40c9948
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Oct 26 21:39:13 2020 +0100
patch 8.2.1910: reading past the end of the command line
Problem: Reading past the end of the command line.
Solution: Check for NUL. (closes https://github.com/vim/vim/issues/7204)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 26 Oct 2020 21:45:04 +0100 |
parents | e82579016863 |
children | 4c21a3a47707 |
comparison
equal
deleted
inserted
replaced
22723:5b7ea82bc18f | 22724:51bc501a13ca |
---|---|
2956 OPT_FREE, SID_NONE); | 2956 OPT_FREE, SID_NONE); |
2957 free_string_option(cmod->cmod_save_ei); | 2957 free_string_option(cmod->cmod_save_ei); |
2958 cmod->cmod_save_ei = NULL; | 2958 cmod->cmod_save_ei = NULL; |
2959 } | 2959 } |
2960 | 2960 |
2961 if (cmod->cmod_filter_regmatch.regprog != NULL) | 2961 vim_regfree(cmod->cmod_filter_regmatch.regprog); |
2962 vim_regfree(cmod->cmod_filter_regmatch.regprog); | |
2963 | 2962 |
2964 if (cmod->cmod_save_msg_silent > 0) | 2963 if (cmod->cmod_save_msg_silent > 0) |
2965 { | 2964 { |
2966 // messages could be enabled for a serious error, need to check if the | 2965 // messages could be enabled for a serious error, need to check if the |
2967 // counters don't become negative | 2966 // counters don't become negative |
4694 // Skip over `=expr` when wildcards are expanded. | 4693 // Skip over `=expr` when wildcards are expanded. |
4695 else if (p[0] == '`' && p[1] == '=' && (eap->argt & EX_XFILE)) | 4694 else if (p[0] == '`' && p[1] == '=' && (eap->argt & EX_XFILE)) |
4696 { | 4695 { |
4697 p += 2; | 4696 p += 2; |
4698 (void)skip_expr(&p, NULL); | 4697 (void)skip_expr(&p, NULL); |
4698 if (*p == NUL) // stop at NUL after CTRL-V | |
4699 break; | |
4699 } | 4700 } |
4700 #endif | 4701 #endif |
4701 | 4702 |
4702 // Check for '"': start of comment or '|': next command | 4703 // Check for '"': start of comment or '|': next command |
4703 // :@" and :*" do not start a comment! | 4704 // :@" and :*" do not start a comment! |