Commit: patch 9.1.2113: potential NULL pointer dereference issues

7 views
Skip to first unread message

Christian Brabandt

unread,
Jan 29, 2026, 1:46:31 PMJan 29
to vim...@googlegroups.com
patch 9.1.2113: potential NULL pointer dereference issues

Commit: https://github.com/vim/vim/commit/d0502fdb26cedf7b13e9491ec14e8e7daf4ca6fe
Author: Yasuhiro Matsumoto <matt...@gmail.com>
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 <matt...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

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,
/**/

Christ van Willegen

unread,
Jan 29, 2026, 4:43:17 PMJan 29
to vim...@googlegroups.com
Hi, 

Op do 29 jan 2026, 19:46 schreef Christian Brabandt <cbl...@256bit.org>:
patch 9.1.2113: potential NULL pointer dereference issues

Commit:
--- a/src/terminal.c
+++ b/src/terminal.c

+    state = vterm_obtain_state(vterm);
+    if (state == NULL)
+    {
+       return FALSE;
+    }

The {} are unneeded.

Christ van Willegen

Christian Brabandt

unread,
Jan 30, 2026, 4:50:04 AMJan 30
to vim...@googlegroups.com
Thanks,
Christian
--
To be or not to be.
-- Shakespeare
To do is to be.
-- Nietzsche
To be is to do.
-- Sartre
Do be do be do.
-- Sinatra
Reply all
Reply to author
Forward
0 new messages