Problem: Crash with overlong emacs tag file, because of an OOB buffer
read (ehdgks0627, un3xploitable)
Solution: Check for end of buffer and return early.
Github Advisory:
https://github.com/vim/vim/security/advisories/GHSA-h4mf-vg97-hj8j
Signed-off-by: Christian Brabandt <cb@256bit.org>
for (p = st->ebuf; *p && *p != ','; p++)
;
+ // invalid
+ if (*p == NUL)
+ return;
*p = NUL;
// check for an included tags file.
set tags&
endfunc
+" This used to crash Vim
+func Test_evil_emacs_tagfile()
+ CheckFeature emacs_tags
+ let longline = repeat('a', 515)
+ call writefile([
+ \ "\x0c",
+ \ longline
+ \ ], 'Xtags', 'D')
+ set tags=Xtags
+
+ call assert_fails(':tag a', 'E426:')
+
+ set tags&
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 74,
/**/
73,
/**/