From d0502fdb26cedf7b13e9491ec14e8e7daf4ca6fe Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Thu, 29 Jan 2026 18:43:12 +0000 Subject: [PATCH] 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 Signed-off-by: Christian Brabandt --- src/clientserver.c | 2 +- src/terminal.c | 10 +++++++++- src/version.c | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/clientserver.c b/src/clientserver.c index 57bdf96d0e..028da5c063 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 de187f7ca7..17a7758fa0 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 f989c2ae4c..f79353e517 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, /**/ -- 2.47.3