0
0
mirror of https://github.com/vim/vim.git synced 2025-10-22 08:34:29 -04:00

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.
This commit is contained in:
Bram Moolenaar
2023-04-23 21:42:25 +01:00
parent aae583441b
commit 2354b66ac5
4 changed files with 36 additions and 0 deletions

View File

@@ -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
{