patch 9.2.0039: potential integer underflow in screen_line()

Commit: 
https://github.com/vim/vim/commit/402eb5b5a6de2b16824eeefa7c4ef8cfd565a7d5
Author: Christian Brabandt <[email protected]>
Date:   Sat Feb 21 10:50:20 2026 +0000

    patch 9.2.0039: potential integer underflow in screen_line()
    
    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 <[email protected]>

diff --git a/src/screen.c b/src/screen.c
index 6e6f11b70..b3fe3705e 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -848,7 +848,7 @@ skip_opacity:
 #ifdef FEAT_GUI
                && !gui.in_use
 #endif
-               && col + coloff > 0)
+               && col + coloff > 0 && off_to > 0)
        {
            if (ScreenAttrs[off_to] == ScreenAttrs[off_to - 1])
            {
diff --git a/src/version.c b/src/version.c
index 871f3b239..336ac8894 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    39,
 /**/
     38,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1vtqKp-00662q-BA%40256bit.org.

Raspunde prin e-mail lui