Problem: Crash when using search pattern \%Ufffffc23.
Solution: Limit character to INT_MAX. (closes #4009)
default: nr = -1; break;
}
- if (nr < 0)
+ if (nr < 0 || nr > INT_MAX)
EMSG2_RET_FAIL(
_("E678: Invalid character after %s%%[dxouU]"),
reg_magic == MAGIC_ALL);
call assert_equal(bufcontent[1], @/)
call Incsearch_cleanup()
endfunc
+
+func Test_large_hex_chars()
+ " This used to cause a crash, the character becomes an NFA state.
+ try
+ /\%Ufffffc23
+ catch
+ call assert_match('E678:', v:exception)
+ endtry
+endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 968,
/**/
967,
/**/