From 28ac4a99f270fa866fa025a858ff6a503ef81a24 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 25 Sep 2018 22:57:45 -0400 Subject: [PATCH 1/2] vim-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(). https://github.com/vim/vim/commit/31cbadf74bccc2a5cd8233bc31bbcfe466b00021 --- src/nvim/ex_getln.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 9be61f0740..e0a4f78083 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -793,9 +793,11 @@ static int command_line_execute(VimState *state, int key) no_mapping--; // CTRL-\ e doesn't work when obtaining an expression, unless it // is in a mapping. - if (s->c != Ctrl_N && s->c != Ctrl_G && (s->c != 'e' - || (ccline.cmdfirstc == '=' - && KeyTyped))) { + if (s->c != Ctrl_N + && s->c != Ctrl_G + && (s->c != 'e' + || (ccline.cmdfirstc == '=' && KeyTyped) + || cmdline_star)) { vungetc(s->c); s->c = Ctrl_BSL; } else if (s->c == 'e') { @@ -1350,7 +1352,8 @@ static int command_line_handle_key(CommandLineState *s) // a new one... new_cmdpos = -1; if (s->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(); s->c = ESC; } else { From c6350e415077b877937753edef038fde10caa4f4 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 25 Sep 2018 23:10:26 -0400 Subject: [PATCH 2/2] vim-patch:8.1.0436: can get the text of inputsecret() with getcmdline() Problem: Can get the text of inputsecret() with getcmdline(). (Tommy Allen) Solution: Don't return the text. https://github.com/vim/vim/commit/ee91c33570008aefd2d62b8f88b22db751acacbe --- src/nvim/ex_getln.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index e0a4f78083..4d6720ef23 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -797,7 +797,7 @@ static int command_line_execute(VimState *state, int key) && s->c != Ctrl_G && (s->c != 'e' || (ccline.cmdfirstc == '=' && KeyTyped) - || cmdline_star)) { + || cmdline_star > 0)) { vungetc(s->c); s->c = Ctrl_BSL; } else if (s->c == 'e') { @@ -1353,7 +1353,7 @@ static int command_line_handle_key(CommandLineState *s) new_cmdpos = -1; if (s->c == '=') { if (ccline.cmdfirstc == '=' // can't do this recursively - || cmdline_star) { // or when typing a password + || cmdline_star > 0) { // or when typing a password beep_flush(); s->c = ESC; } else { @@ -5590,6 +5590,9 @@ static struct cmdline_info *get_ccline_ptr(void) */ char_u *get_cmdline_str(void) { + if (cmdline_star > 0) { + return NULL; + } struct cmdline_info *p = get_ccline_ptr(); if (p == NULL)