]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.2113: potential NULL pointer dereference issues v9.1.2113
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Thu, 29 Jan 2026 18:43:12 +0000 (18:43 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 29 Jan 2026 18:43:12 +0000 (18:43 +0000)
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 <mattn.jp@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/clientserver.c
src/terminal.c
src/version.c

index 57bdf96d0ea3b1871369c2e607989b7a76c6e8d0..028da5c06388cb620efcc44a3203af36b8667988 100644 (file)
@@ -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.
index de187f7ca73e5b7f1768ee2ebaaa722426c11869..17a7758fa0c2f342bbd3f9ebee27bf61c91a88bd 100644 (file)
@@ -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.
index f989c2ae4ce39f0662e99a1f124d516d365fcec9..f79353e517afbd925a9829541b19f1174abfa03e 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2113,
 /**/
     2112,
 /**/