Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
32300:174795e383bf | 32301:15352bf5c33e |
---|---|
663 | 663 |
664 if (above) | 664 if (above) |
665 { | 665 { |
666 before = 0; | 666 before = 0; |
667 after = wp->w_width - cells - win_col_off(wp) - padding; | 667 after = wp->w_width - cells - win_col_off(wp) - padding; |
668 if (after < 0) | |
669 { | |
670 // text "above" has too much padding to fit | |
671 padding += after; | |
672 after = 0; | |
673 } | |
668 } | 674 } |
669 else | 675 else |
670 { | 676 { |
671 // Right-align: fill with before | 677 // Right-align: fill with before |
672 if (right) | 678 if (right) |