0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.1.0433: mapping can obtain text from inputsecret()

Problem:    Mapping can obtain text from inputsecret(). (Tommy Allen)
Solution:   Disallow CTRL-R = and CTRL-\ e when using inputsecret().
This commit is contained in:
Bram Moolenaar
2018-09-25 20:48:57 +02:00
parent 45c5c86e63
commit 31cbadf74b
2 changed files with 9 additions and 2 deletions

View File

@@ -1308,7 +1308,11 @@ getcmdline(
/* CTRL-\ e doesn't work when obtaining an expression, unless it /* CTRL-\ e doesn't work when obtaining an expression, unless it
* is in a mapping. */ * is in a mapping. */
if (c != Ctrl_N && c != Ctrl_G && (c != 'e' if (c != Ctrl_N && c != Ctrl_G && (c != 'e'
|| (ccline.cmdfirstc == '=' && KeyTyped))) || (ccline.cmdfirstc == '=' && KeyTyped)
#ifdef FEAT_EVAL
|| cmdline_star
#endif
))
{ {
vungetc(c); vungetc(c);
c = Ctrl_BSL; c = Ctrl_BSL;
@@ -1801,7 +1805,8 @@ getcmdline(
new_cmdpos = -1; new_cmdpos = -1;
if (c == '=') if (c == '=')
{ {
if (ccline.cmdfirstc == '=')/* can't do this recursively */ if (ccline.cmdfirstc == '=' // can't do this recursively
|| cmdline_star) // or when typing a password
{ {
beep_flush(); beep_flush();
c = ESC; c = ESC;

View File

@@ -794,6 +794,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
433,
/**/ /**/
432, 432,
/**/ /**/