Permalink
Browse files

patch 8.0.0561: undefined behavior when using backslash after empty line

Problem:    Undefined behavior when using backslash after empty line.
Solution:   Check for an empty line. (Dominique Pelle, closes #1631)
  • Loading branch information...
brammool committed Apr 10, 2017
1 parent 451a4a1 commit 478af67dd6a9adc456464c3736bda328ae3a28cb
Showing with 14 additions and 1 deletion.
  1. +1 −1 src/misc2.c
  2. +11 −0 src/testdir/test_vimscript.vim
  3. +2 −0 src/version.c
View
@@ -2129,7 +2129,7 @@ ga_concat(garray_T *gap, char_u *s)
{
int len;
if (s == NULL)
if (s == NULL || *s == NUL)
return;
len = (int)STRLEN(s);
if (ga_grow(gap, len) == OK)
@@ -1309,6 +1309,17 @@ func Test_script_lines()
endtry
endfunc
"-------------------------------------------------------------------------------
" Test 96: line continuation {{{1
"
" Undefined behavior was detected by ubsan with line continuation
" after an empty line.
"-------------------------------------------------------------------------------
func Test_script_emty_line_continuation()
\
endfunc
"-------------------------------------------------------------------------------
" Modelines {{{1
" vim: ts=8 sw=4 tw=80 fdm=marker
View
@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
561,
/**/
560,
/**/

0 comments on commit 478af67

Please sign in to comment.