diff src/drawline.c @ 32301:15352bf5c33e v9.0.1482

patch 9.0.1482: crash when textprop has a very large "padding" value Commit: https://github.com/vim/vim/commit/2354b66ac52a8a9165e8bd0d642e19e757ba12c3 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 23 21:42:25 2023 +0100 patch 9.0.1482: crash when textprop has a very large "padding" value Problem: Crash when textprop has a very large "padding" value. (Yegappan Lakshmanan) Solution: Avoid the "after" count to go negative.
author Bram Moolenaar <Bram@vim.org>
date Sun, 23 Apr 2023 22:45:04 +0200
parents 0df66713766e
children 8323e235ff44
line wrap: on
line diff
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -665,6 +665,12 @@ text_prop_position(
 	{
 	    before = 0;
 	    after = wp->w_width - cells - win_col_off(wp) - padding;
+	    if (after < 0)
+	    {
+		// text "above" has too much padding to fit
+		padding += after;
+		after = 0;
+	    }
 	}
 	else
 	{