patch 9.1.2113: potential NULL pointer dereference issues

Commit: 
https://github.com/vim/vim/commit/d0502fdb26cedf7b13e9491ec14e8e7daf4ca6fe
Author: Yasuhiro Matsumoto <[email protected]>
Date:   Thu Jan 29 18:43:12 2026 +0000

    patch 9.1.2113: potential NULL pointer dereference issues
    
    Problem:  potential NULL pointer dereference issues
              (EpheraXun)
    Solution: Check returned pointer to be non NULL.
              (Yasuhiro Matsumoto)
    
    fixes:  #19273
    closes: #19274
    
    Signed-off-by: Yasuhiro Matsumoto <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/clientserver.c b/src/clientserver.c
index 57bdf96d0..028da5c06 100644
--- a/src/clientserver.c
+++ b/src/clientserver.c
@@ -42,7 +42,7 @@ server_to_input_buf(char_u *str)
     str = replace_termcodes(str, &ptr, 0, REPTERM_DO_LT, NULL);
     p_cpo = cpo_save;
 
-    if (*ptr != NUL)   // trailing CTRL-V results in nothing
+    if (ptr != NULL && *ptr != NUL)    // trailing CTRL-V results in nothing
     {
        /*
         * Add the string to the input stream.
diff --git a/src/terminal.c b/src/terminal.c
index de187f7ca..17a7758fa 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -1482,9 +1482,17 @@ term_mouse_click(VTerm *vterm, int key)
     // For modeless selection mouse drag and release events are ignored, unless
     // they are preceded with a mouse down event
     static int     ignore_drag_release = TRUE;
+    VTermState     *state;
     VTermMouseState mouse_state;
 
-    vterm_state_get_mousestate(vterm_obtain_state(vterm), &mouse_state);
+
+    state = vterm_obtain_state(vterm);
+    if (state == NULL)
+    {
+       return FALSE;
+    }
+
+    vterm_state_get_mousestate(state, &mouse_state);
     if (mouse_state.flags == 0)
     {
        // Terminal is not using the mouse, use modeless selection.
diff --git a/src/version.c b/src/version.c
index f989c2ae4..f79353e51 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 */
+/**/
+    2113,
 /**/
     2112,
 /**/

-- 
-- 
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/E1vlX0u-002bor-8s%40256bit.org.

Raspunde prin e-mail lui