Blame SOURCES/0001-patch-8.2.4436-crash-with-weird-vartabstop-value.patch

da4393
diff --git a/src/indent.c b/src/indent.c
da4393
index 77d8b0a..9830685 100644
da4393
--- a/src/indent.c
da4393
+++ b/src/indent.c
da4393
@@ -1284,6 +1284,8 @@ change_indent(
da4393
 		new_cursor_col += (*mb_ptr2len)(ptr + new_cursor_col);
da4393
 	    else
da4393
 		++new_cursor_col;
da4393
+	    if (ptr[new_cursor_col] == NUL)
da4393
+		break;
da4393
 	    vcol += lbr_chartabsize(ptr, ptr + new_cursor_col, (colnr_T)vcol);
da4393
 	}
da4393
 	vcol = last_vcol;
da4393
diff --git a/src/testdir/test_vartabs.vim b/src/testdir/test_vartabs.vim
da4393
index 0ff1ea8..a613510 100644
da4393
--- a/src/testdir/test_vartabs.vim
da4393
+++ b/src/testdir/test_vartabs.vim
da4393
@@ -419,4 +419,17 @@ func Test_varsofttabstop()
da4393
   close!
da4393
 endfunc
da4393
 
da4393
+func Test_vartabstop_latin1()
da4393
+  let save_encoding = &encoding
da4393
+  new
da4393
+  set encoding=iso8859-1
da4393
+  set compatible linebreak list revins smarttab
da4393
+  set vartabstop=400
da4393
+  exe "norm i00\t\<C-D>"
da4393
+  bwipe!
da4393
+  let &encoding = save_encoding
da4393
+  set nocompatible linebreak& list& revins& smarttab& vartabstop&
da4393
+endfunc
da4393
+
da4393
+
da4393
 " vim: shiftwidth=2 sts=2 expandtab