File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -786,7 +786,8 @@ ins_compl_add(
786786 {
787787 if (!match_at_original_text (match )
788788 && STRNCMP (match -> cp_str , str , len ) == 0
789- && match -> cp_str [len ] == NUL )
789+ && ((int )STRLEN (match -> cp_str ) <= len
790+ || match -> cp_str [len ] == NUL ))
790791 return NOTDONE ;
791792 match = match -> cp_next ;
792793 } while (match != NULL && !is_first_match (match ));
Original file line number Diff line number Diff line change @@ -2112,5 +2112,15 @@ func Test_infercase_very_long_line()
21122112 set noic noinfercase
21132113endfunc
21142114
2115+ func Test_ins_complete_add ()
2116+ " this was reading past the end of allocated memory
2117+ new
2118+ norm o
2119+ norm 7 o
2120+ sil ! norm o
2121+
2122+ bwipe!
2123+ endfunc
2124+
21152125
21162126" vim: shiftwidth = 2 sts = 2 expandtab
Original file line number Diff line number Diff line change @@ -735,6 +735,8 @@ static char *(features[]) =
735735
736736static int included_patches [] =
737737{ /* Add new patch number below this line */
738+ /**/
739+ 46 ,
738740/**/
739741 45 ,
740742/**/
You can’t perform that action at this time.
0 commit comments