Problem: In screen_line(), there is a potential integer underflow when
accessing ScreenAttrs[off_to - 1] if off_to is zero.
(Coverity CID
1681430, after v9.2.0017)
Solution: Add a check to ensure off_to > 0 before accessing the
previous attribute index.
related: #19272
closes: #19479
Signed-off-by: Christian Brabandt <cb@256bit.org>
#ifdef FEAT_GUI
&& !gui.in_use
#endif
- && col + coloff > 0)
+ && col + coloff > 0 && off_to > 0)
{
if (ScreenAttrs[off_to] == ScreenAttrs[off_to - 1])
{
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 39,
/**/
38,
/**/