# HG changeset patch # User Christian Brabandt # Date 1467367205 -7200 # Node ID b88c573d8aa4089afdc3fdff8c5f2b99d599ad7a # Parent b46e82041b5f4d8c916f7061ec1bbae0fe5ec4c3 commit https://github.com/vim/vim/commit/1d90a5a5af84250e226f8a9121e771f7b72aa894 Author: Bram Moolenaar Date: Fri Jul 1 11:59:47 2016 +0200 patch 7.4.1968 Problem: Invalid memory access with "\. Solution: Do not recognize this as a special character. (Dominique Pelle) diff --git a/src/misc2.c b/src/misc2.c --- a/src/misc2.c +++ b/src/misc2.c @@ -2741,8 +2741,10 @@ find_special_key( else #endif l = 1; - if (bp[l + 1] == '>') - bp += l; /* anything accepted, like */ + /* Anything accepted, like , except , because the " + * ends the string. */ + if (bp[l] != '"' && bp[l + 1] == '>') + bp += l; } } if (bp[0] == 't' && bp[1] == '_' && bp[2] && bp[3]) diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim --- a/src/testdir/test_expr.vim +++ b/src/testdir/test_expr.vim @@ -101,3 +101,8 @@ endfunc func Test_set_reg_null_list() call setreg('x', test_null_list()) endfunc + +func Test_special_char() + " The failure is only visible using valgrind. + call assert_fails('echo "\') +endfunc diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -754,6 +754,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1968, +/**/ 1967, /**/ 1966,